:root {
  --ink-950: #030b12;
  --ink-925: #05101a;
  --ink-900: #07131f;
  --ink-850: #0a1b2a;
  --ink-800: #0d2334;
  --ink-750: #112c40;
  --line: rgba(134, 203, 222, 0.16);
  --line-strong: rgba(73, 211, 235, 0.32);
  --cyan: #22d3ee;
  --cyan-bright: #67e8f9;
  --cyan-deep: #0891b2;
  --teal: #2dd4bf;
  --amber: #fbbf24;
  --orange: #fb923c;
  --red: #fb7185;
  --green: #4ade80;
  --text: #eefcff;
  --text-soft: #b5d0d8;
  --muted: #789aa6;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  --radius-xl: 24px;
  --radius-lg: 17px;
  --radius-md: 12px;
  --sidebar-width: 270px;
  --heading-font: "Bahnschrift SemiCondensed", "Aptos Display", sans-serif;
  --body-font: "Aptos", "Segoe UI Variable Text", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--ink-950);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 75% -10%, rgba(8, 145, 178, 0.16), transparent 33rem),
    var(--ink-950);
  font-family: var(--body-font);
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

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

button,
select {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

a {
  color: var(--cyan-bright);
}

[hidden] {
  display: none !important;
}

::selection {
  color: var(--ink-950);
  background: var(--cyan-bright);
}

:focus-visible {
  outline: 2px solid var(--cyan-bright);
  outline-offset: 3px;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 9999;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: var(--ink-950);
  background: var(--cyan-bright);
  border-radius: 8px;
  font-weight: 800;
  transform: translateY(-150%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* Login */
.login-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, 0.92fr);
  min-height: 100vh;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(115deg, rgba(5, 16, 26, 0.22), rgba(5, 16, 26, 0.93) 65%),
    radial-gradient(circle at 20% 28%, rgba(34, 211, 238, 0.14), transparent 26rem),
    #04101a;
}

.login-atmosphere,
.login-atmosphere::before,
.login-atmosphere::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.login-atmosphere {
  z-index: -1;
  overflow: hidden;
}

.login-atmosphere::before {
  content: "";
  background-image:
    linear-gradient(rgba(53, 154, 181, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(53, 154, 181, 0.055) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(90deg, #000 0%, transparent 74%);
}

.login-atmosphere::after {
  content: "";
  left: 46%;
  width: 1px;
  background: linear-gradient(transparent 5%, rgba(34, 211, 238, 0.36), transparent 95%);
  box-shadow: 0 0 36px rgba(34, 211, 238, 0.2);
}

.orbit {
  position: absolute;
  display: block;
  border: 1px solid rgba(34, 211, 238, 0.12);
  border-radius: 50%;
}

.orbit::before {
  position: absolute;
  content: "";
  width: 8px;
  height: 8px;
  top: 50%;
  left: -4px;
  background: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 24px var(--cyan);
}

.orbit-one {
  width: 560px;
  height: 560px;
  top: -230px;
  left: -170px;
  animation: orbit-spin 26s linear infinite;
}

.orbit-two {
  width: 380px;
  height: 380px;
  left: 22%;
  bottom: -260px;
  animation: orbit-spin 20s linear infinite reverse;
}

.scan-grid {
  position: absolute;
  width: 42%;
  height: 160%;
  top: -30%;
  left: 14%;
  border-left: 1px solid rgba(34, 211, 238, 0.08);
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.035), transparent);
  transform: rotate(18deg);
}

.login-brand {
  align-self: center;
  max-width: 660px;
  padding: clamp(48px, 8vw, 110px);
  animation: reveal-up 560ms ease both;
}

.brand-mark {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 48px;
  place-items: center;
  color: var(--text);
  background: linear-gradient(150deg, rgba(34, 211, 238, 0.2), rgba(8, 145, 178, 0.05));
  border: 1px solid rgba(103, 232, 249, 0.54);
  clip-path: polygon(50% 0, 94% 18%, 88% 76%, 50% 100%, 12% 76%, 6% 18%);
  font-family: var(--heading-font);
  font-size: 20px;
  font-weight: 900;
}

.brand-mark::after {
  position: absolute;
  inset: 5px;
  content: "";
  border: 1px solid rgba(103, 232, 249, 0.22);
  clip-path: inherit;
}

.brand-mark-large {
  width: 66px;
  height: 76px;
  margin-bottom: 30px;
  font-size: 30px;
  filter: drop-shadow(0 0 24px rgba(34, 211, 238, 0.24));
}

.kicker,
.panel-signal,
.modal-kicker,
.page-kicker,
.topbar-heading p,
.section-label {
  margin: 0;
  color: var(--cyan-bright);
  font-family: var(--heading-font);
  font-size: 11px;
  font-stretch: condensed;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.login-brand h1 {
  max-width: 620px;
  margin: 12px 0 24px;
  font-family: var(--heading-font);
  font-size: clamp(48px, 6.2vw, 86px);
  font-stretch: condensed;
  line-height: 0.91;
  letter-spacing: -0.055em;
  text-transform: uppercase;
}

.login-brand h1 em {
  color: transparent;
  background: linear-gradient(90deg, var(--cyan-bright), #d7fbff 70%);
  background-clip: text;
  font-style: normal;
}

.login-intro {
  max-width: 540px;
  margin: 0;
  color: var(--text-soft);
  font-size: 17px;
}

.trust-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  margin-top: 38px;
  color: var(--muted);
  font-size: 13px;
}

.trust-list span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.trust-list i {
  width: 6px;
  height: 6px;
  background: var(--teal);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(45, 212, 191, 0.7);
}

.login-panel-wrap {
  display: grid;
  min-height: 100%;
  padding: 36px clamp(24px, 5vw, 84px);
  place-items: center;
  background: linear-gradient(145deg, rgba(9, 27, 42, 0.78), rgba(3, 11, 18, 0.94));
  backdrop-filter: blur(20px);
}

.login-panel {
  width: min(100%, 470px);
  padding: clamp(28px, 5vw, 48px);
  background:
    linear-gradient(135deg, rgba(21, 52, 70, 0.52), rgba(6, 19, 30, 0.72)),
    rgba(6, 20, 31, 0.88);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, 0.035);
  animation: reveal-up 600ms 100ms ease both;
}

.panel-signal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: rgba(34, 211, 238, 0.07);
  border: 1px solid rgba(34, 211, 238, 0.16);
  border-radius: 999px;
}

.panel-signal span,
.status-led,
.connection-state span {
  width: 7px;
  height: 7px;
  background: var(--teal);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(45, 212, 191, 0.8);
}

.login-panel h2 {
  margin: 24px 0 5px;
  font-family: var(--heading-font);
  font-size: 30px;
  letter-spacing: -0.025em;
}

.login-panel > p {
  margin: 0 0 28px;
  color: var(--muted);
}

.field-label {
  display: block;
  margin: 17px 0 7px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
}

.input-shell {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  min-height: 52px;
  align-items: center;
  padding: 0 13px;
  background: rgba(2, 11, 18, 0.58);
  border: 1px solid rgba(133, 191, 208, 0.2);
  border-radius: var(--radius-md);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.input-shell:focus-within {
  background: rgba(3, 15, 24, 0.84);
  border-color: rgba(34, 211, 238, 0.72);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.08);
}

.input-shell input {
  min-width: 0;
  height: 50px;
  padding: 0 7px;
  background: transparent;
  border: 0;
  outline: 0;
}

.input-shell input::placeholder {
  color: #4f727f;
}

.input-icon {
  color: var(--cyan);
  font-family: var(--heading-font);
  font-size: 15px;
  font-weight: 800;
  text-align: center;
}

.lock-icon {
  position: relative;
  width: 12px;
  height: 10px;
  margin: 6px auto 0;
  border: 1.5px solid var(--cyan);
  border-radius: 2px;
}

.lock-icon::before {
  position: absolute;
  width: 7px;
  height: 7px;
  left: 1px;
  top: -7px;
  content: "";
  border: 1.5px solid var(--cyan);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
}

.input-action {
  padding: 7px;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 800;
}

.primary-command,
.button {
  display: inline-flex;
  min-height: 43px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 16px;
  border-radius: 10px;
  font-weight: 800;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.primary-command {
  width: 100%;
  height: 54px;
  margin-top: 24px;
  color: #03202a;
  background: linear-gradient(105deg, var(--cyan-bright), var(--cyan));
  border: 0;
  box-shadow: 0 10px 30px rgba(8, 145, 178, 0.2);
}

.primary-command b {
  font-size: 20px;
  transition: transform 160ms ease;
}

.primary-command:hover:not(:disabled),
.button-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 34px rgba(34, 211, 238, 0.22);
}

.primary-command:hover b {
  transform: translateX(4px);
}

.form-error,
.configuration-warning {
  padding: 11px 13px;
  border-radius: 9px;
  font-size: 13px;
}

.form-error {
  margin: 15px 0 -8px;
  color: #fecdd3;
  background: rgba(190, 24, 93, 0.11);
  border: 1px solid rgba(251, 113, 133, 0.28);
}

.configuration-warning {
  display: grid;
  gap: 3px;
  margin: 18px 0;
  color: #fde68a;
  background: rgba(180, 83, 9, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.28);
}

.configuration-warning span {
  color: #d9bf83;
}

.configuration-warning code {
  color: #fff1b9;
}

.login-footnote {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 12px;
}

/* Application shell */
.app-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at 88% 0%, rgba(8, 145, 178, 0.11), transparent 28rem),
    var(--ink-925);
}

.sidebar {
  position: fixed;
  z-index: 50;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 24px 18px 20px;
  background:
    linear-gradient(rgba(8, 25, 38, 0.96), rgba(3, 12, 20, 0.98)),
    var(--ink-900);
  border-right: 1px solid var(--line);
  box-shadow: 18px 0 60px rgba(0, 0, 0, 0.13);
}

.sidebar::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: 0.35;
  background-image: linear-gradient(rgba(34, 211, 238, 0.03) 1px, transparent 1px);
  background-size: 100% 36px;
  pointer-events: none;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 8px 24px;
}

.sidebar-brand strong,
.sidebar-brand small {
  display: block;
  font-family: var(--heading-font);
  line-height: 1;
  letter-spacing: 0.12em;
}

.sidebar-brand strong {
  font-size: 19px;
}

.sidebar-brand small {
  margin-top: 5px;
  color: var(--cyan);
  font-size: 9px;
}

.workspace-picker {
  padding: 12px;
  background: rgba(12, 36, 52, 0.62);
  border: 1px solid var(--line);
  border-radius: 13px;
}

.workspace-picker label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.workspace-picker select {
  width: 100%;
  padding: 7px 26px 7px 0;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 13px;
  font-weight: 800;
}

.workspace-picker option {
  color: var(--text);
  background: var(--ink-800);
}

.main-nav {
  display: grid;
  gap: 5px;
  margin-top: 24px;
}

.nav-item {
  position: relative;
  display: grid;
  grid-template-columns: 25px 1fr auto;
  min-height: 48px;
  align-items: center;
  gap: 11px;
  padding: 0 12px;
  color: #789aa7;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  text-align: left;
  transition: color 150ms ease, background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.nav-item::before {
  position: absolute;
  width: 3px;
  height: 22px;
  left: -19px;
  content: "";
  background: var(--cyan);
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 15px rgba(34, 211, 238, 0.7);
  opacity: 0;
}

.nav-item:hover {
  color: var(--text-soft);
  background: rgba(34, 211, 238, 0.04);
  transform: translateX(2px);
}

.nav-item.active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.12), rgba(34, 211, 238, 0.035));
  border-color: rgba(34, 211, 238, 0.14);
}

.nav-item.active::before {
  opacity: 1;
}

.nav-item b {
  font-size: 13px;
}

.nav-item small {
  color: #466b78;
  font-family: var(--heading-font);
  font-size: 9px;
}

.nav-item svg {
  display: block;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.sidebar-security {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding: 13px;
  background: rgba(45, 212, 191, 0.045);
  border: 1px solid rgba(45, 212, 191, 0.12);
  border-radius: 12px;
}

.sidebar-security strong,
.sidebar-security small {
  display: block;
}

.sidebar-security strong {
  color: #bffcf0;
  font-size: 11px;
}

.sidebar-security small {
  margin-top: 2px;
  color: #628f8b;
  font-size: 9px;
}

.security-pulse {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(45, 212, 191, 0.25);
  border-radius: 50%;
}

.security-pulse span {
  width: 8px;
  height: 8px;
  background: var(--teal);
  border-radius: 50%;
  box-shadow: 0 0 14px rgba(45, 212, 191, 0.8);
  animation: security-pulse 2.2s ease infinite;
}

.workspace {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 13px clamp(20px, 3.2vw, 46px);
  background: rgba(5, 16, 26, 0.84);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.topbar-heading p {
  color: #4d899a;
  font-size: 9px;
}

.topbar-heading h1 {
  margin: 1px 0 0;
  font-family: var(--heading-font);
  font-size: clamp(19px, 2vw, 26px);
  letter-spacing: -0.02em;
}

.topbar-actions,
.connection-state,
.account-chip {
  display: flex;
  align-items: center;
}

.topbar-actions {
  gap: 12px;
}

.connection-state {
  gap: 8px;
  padding: 8px 11px;
  color: #9bc6c3;
  background: rgba(45, 212, 191, 0.045);
  border: 1px solid rgba(45, 212, 191, 0.1);
  border-radius: 999px;
  font-size: 10px;
}

.connection-state.offline {
  color: #fda4af;
  background: rgba(251, 113, 133, 0.06);
  border-color: rgba(251, 113, 133, 0.16);
}

.connection-state.offline span {
  background: var(--red);
  box-shadow: 0 0 12px rgba(251, 113, 133, 0.8);
}

.refresh-button,
.icon-button {
  min-height: 38px;
  color: var(--text-soft);
  background: rgba(13, 35, 52, 0.72);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.refresh-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 800;
}

.refresh-button:hover,
.icon-button:hover {
  color: var(--cyan-bright);
  border-color: var(--line-strong);
}

.refresh-button.loading span {
  animation: orbit-spin 0.7s linear infinite;
}

.account-chip {
  gap: 9px;
  padding-left: 11px;
  border-left: 1px solid var(--line);
}

.account-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--cyan-bright);
  background: linear-gradient(145deg, #123447, #0a1c2a);
  border: 1px solid rgba(34, 211, 238, 0.25);
  border-radius: 9px;
  font-family: var(--heading-font);
  font-weight: 900;
}

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

.account-chip strong {
  font-size: 11px;
}

.account-chip small {
  color: var(--muted);
  font-size: 9px;
}

.account-chip button {
  padding: 7px 8px;
  color: #7da4af;
  background: transparent;
  border: 0;
  font-size: 10px;
  font-weight: 800;
}

.account-chip button:hover {
  color: var(--red);
}

.mobile-menu {
  display: none;
  width: 40px;
}

.main-content {
  min-height: calc(100vh - 78px);
  padding: clamp(22px, 3.4vw, 48px);
}

.page-enter {
  animation: reveal-up 310ms ease both;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 27px;
}

.page-heading h2 {
  margin: 4px 0 6px;
  font-family: var(--heading-font);
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1;
  letter-spacing: -0.035em;
}

.page-heading p:last-child {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: flex-end;
}

.button {
  border: 1px solid var(--line);
  font-size: 12px;
}

.button-primary {
  color: #03202a;
  background: linear-gradient(110deg, var(--cyan-bright), var(--cyan));
  border-color: transparent;
}

.button-secondary {
  color: var(--text-soft);
  background: rgba(13, 35, 52, 0.72);
}

.button-secondary:hover:not(:disabled) {
  color: var(--cyan-bright);
  border-color: var(--line-strong);
}

.button-danger {
  color: #fecdd3;
  background: rgba(159, 18, 57, 0.12);
  border-color: rgba(251, 113, 133, 0.26);
}

.button-warning {
  color: #fde68a;
  background: rgba(180, 83, 9, 0.12);
  border-color: rgba(251, 191, 36, 0.24);
}

.button-compact {
  min-height: 34px;
  padding: 0 11px;
  font-size: 10px;
}

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

.metric-card,
.panel,
.risk-card,
.product-card {
  background:
    linear-gradient(145deg, rgba(18, 48, 68, 0.56), rgba(6, 20, 31, 0.78)),
    var(--ink-850);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
}

.metric-card {
  position: relative;
  min-height: 148px;
  padding: 19px;
  overflow: hidden;
}

.metric-card::after {
  position: absolute;
  width: 115px;
  height: 115px;
  right: -52px;
  bottom: -55px;
  content: "";
  background: radial-gradient(circle, rgba(34, 211, 238, 0.13), transparent 68%);
}

.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--cyan-bright);
  background: rgba(34, 211, 238, 0.07);
  border: 1px solid rgba(34, 211, 238, 0.13);
  border-radius: 9px;
}

.metric-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.metric-value {
  margin: 18px 0 2px;
  font-family: var(--heading-font);
  font-size: 35px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
}

.metric-note {
  color: var(--muted);
  font-size: 11px;
}

.metric-note strong {
  color: var(--teal);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.55fr);
  gap: 14px;
  margin-top: 14px;
}

.panel {
  padding: 20px;
}

.panel-spaced {
  margin-top: 14px;
}

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

.panel-header h3 {
  margin: 0;
  font-family: var(--heading-font);
  font-size: 18px;
}

.panel-header p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.risk-score {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.risk-gauge {
  --score: 20;
  position: relative;
  display: grid;
  width: 82px;
  height: 82px;
  flex: 0 0 auto;
  place-items: center;
  background: conic-gradient(var(--cyan) calc(var(--score) * 1%), rgba(91, 140, 153, 0.12) 0);
  border-radius: 50%;
}

.risk-gauge::before {
  position: absolute;
  inset: 7px;
  content: "";
  background: var(--ink-850);
  border-radius: 50%;
}

.risk-gauge strong {
  z-index: 1;
  font-family: var(--heading-font);
  font-size: 24px;
}

.risk-gauge.high {
  background: conic-gradient(var(--red) calc(var(--score) * 1%), rgba(91, 140, 153, 0.12) 0);
}

.risk-gauge.score-0 { --score: 0; }
.risk-gauge.score-10 { --score: 10; }
.risk-gauge.score-20 { --score: 20; }
.risk-gauge.score-30 { --score: 30; }
.risk-gauge.score-40 { --score: 40; }
.risk-gauge.score-50 { --score: 50; }
.risk-gauge.score-60 { --score: 60; }
.risk-gauge.score-70 { --score: 70; }
.risk-gauge.score-80 { --score: 80; }
.risk-gauge.score-90 { --score: 90; }
.risk-gauge.score-100 { --score: 100; }

.risk-score h4 {
  margin: 0;
  font-size: 14px;
}

.risk-score p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.risk-list,
.activity-list,
.quick-grid {
  display: grid;
  gap: 9px;
}

.risk-list {
  margin-top: 15px;
}

.risk-item,
.activity-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(134, 203, 222, 0.08);
}

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

.risk-dot {
  width: 8px;
  height: 8px;
  background: var(--amber);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.45);
}

.risk-dot.high {
  background: var(--red);
  box-shadow: 0 0 10px rgba(251, 113, 133, 0.5);
}

.risk-item strong,
.activity-item strong {
  display: block;
  font-size: 11px;
}

.risk-item small,
.activity-item small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.risk-item time,
.activity-item time {
  color: #577b87;
  font-size: 9px;
}

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

.quick-action {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 13px;
  color: var(--text-soft);
  background: rgba(7, 24, 36, 0.66);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: left;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.quick-action:hover {
  background: rgba(13, 41, 57, 0.72);
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.quick-action > span:first-child {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--cyan-bright);
  background: rgba(34, 211, 238, 0.07);
  border-radius: 9px;
}

.quick-action strong,
.quick-action small {
  display: block;
}

.quick-action strong {
  font-size: 11px;
}

.quick-action small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.search-box {
  display: flex;
  width: min(100%, 390px);
  min-height: 41px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: rgba(3, 14, 23, 0.55);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.search-box:focus-within {
  border-color: var(--line-strong);
}

.search-box span {
  color: var(--cyan);
}

.search-box input {
  width: 100%;
  height: 39px;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 12px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.filter-chip {
  min-height: 34px;
  padding: 0 11px;
  color: var(--muted);
  background: rgba(7, 24, 36, 0.54);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
}

.filter-chip.active {
  color: var(--cyan-bright);
  background: rgba(34, 211, 238, 0.08);
  border-color: rgba(34, 211, 238, 0.3);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 13px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.data-table th,
.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(134, 203, 222, 0.09);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  color: #668c98;
  background: rgba(4, 15, 24, 0.66);
  font-family: var(--heading-font);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table tbody tr {
  transition: background 130ms ease;
}

.data-table tbody tr:hover {
  background: rgba(34, 211, 238, 0.025);
}

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

.cell-primary {
  display: block;
  color: var(--text);
  font-weight: 800;
}

.cell-secondary,
.mono {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.mono {
  font-family: "Cascadia Mono", "Consolas", monospace;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 25px;
  padding: 0 8px;
  color: #b8d2d9;
  background: rgba(120, 154, 166, 0.08);
  border: 1px solid rgba(120, 154, 166, 0.16);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-badge::before {
  width: 6px;
  height: 6px;
  content: "";
  background: currentColor;
  border-radius: 50%;
  box-shadow: 0 0 9px currentColor;
}

.status-active,
.status-approved {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.07);
  border-color: rgba(16, 185, 129, 0.18);
}

.status-testing,
.status-pending {
  color: #fde68a;
  background: rgba(251, 191, 36, 0.07);
  border-color: rgba(251, 191, 36, 0.18);
}

.status-disabled,
.status-locked,
.status-expired,
.status-revoked {
  color: #fda4af;
  background: rgba(244, 63, 94, 0.07);
  border-color: rgba(244, 63, 94, 0.18);
}

.status-draft,
.status-archived {
  color: #9eb9c2;
}

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

.product-card {
  position: relative;
  padding: 20px;
  overflow: hidden;
}

.product-card::before {
  position: absolute;
  width: 4px;
  inset: 0 auto 0 0;
  content: "";
  background: linear-gradient(var(--cyan-bright), var(--cyan-deep));
}

.product-card h3 {
  margin: 15px 0 3px;
  font-family: var(--heading-font);
  font-size: 23px;
}

.product-card > p {
  min-height: 40px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

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

.product-meta div {
  padding: 10px;
  background: rgba(3, 14, 23, 0.4);
  border: 1px solid rgba(134, 203, 222, 0.08);
  border-radius: 9px;
}

.product-meta strong,
.product-meta small {
  display: block;
}

.product-meta strong {
  font-family: var(--heading-font);
  font-size: 18px;
}

.product-meta small {
  color: var(--muted);
  font-size: 9px;
}

.empty-state {
  display: grid;
  min-height: 270px;
  place-items: center;
  padding: 40px;
  color: var(--muted);
  text-align: center;
}

.empty-state-compact {
  min-height: 150px;
}

.empty-state-symbol {
  display: grid;
  width: 62px;
  height: 62px;
  margin: 0 auto 15px;
  place-items: center;
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.05);
  border: 1px solid rgba(34, 211, 238, 0.15);
  border-radius: 18px;
  font-size: 25px;
}

.empty-state h3 {
  margin: 0 0 5px;
  color: var(--text-soft);
  font-family: var(--heading-font);
}

.empty-state p {
  max-width: 440px;
  margin: 0 auto 17px;
  font-size: 12px;
}

.audit-entry {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 16px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.audit-entry:last-child {
  border-bottom: 0;
}

.audit-entry time {
  color: var(--muted);
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 9px;
}

.audit-entry strong,
.audit-entry small {
  display: block;
}

.audit-entry strong {
  font-size: 11px;
}

.audit-entry small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.audit-actor {
  color: var(--cyan-bright);
  font-size: 10px;
}

.pagination {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.loading-state {
  position: fixed;
  z-index: 80;
  inset: 78px 0 0 var(--sidebar-width);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 15px;
  color: var(--text-soft);
  background: rgba(3, 11, 18, 0.74);
  backdrop-filter: blur(7px);
}

.loader-ring {
  width: 42px;
  height: 42px;
  border: 2px solid rgba(34, 211, 238, 0.13);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: orbit-spin 0.8s linear infinite;
}

.loading-state strong {
  font-size: 12px;
}

/* Modal and forms */
.modal-layer {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  padding: 20px;
  place-items: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 7, 12, 0.78);
  backdrop-filter: blur(9px);
  animation: fade-in 160ms ease both;
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 560px);
  max-height: calc(100vh - 40px);
  padding: 28px;
  overflow-y: auto;
  background:
    linear-gradient(145deg, rgba(18, 48, 68, 0.58), rgba(5, 17, 27, 0.95)),
    var(--ink-850);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  box-shadow: var(--shadow);
  animation: modal-in 190ms ease both;
}

.modal-card.modal-wide {
  width: min(100%, 780px);
}

.modal-close {
  position: absolute;
  width: 35px;
  height: 35px;
  top: 18px;
  right: 18px;
  color: var(--muted);
  background: rgba(7, 24, 36, 0.68);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 21px;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.modal-card h2 {
  margin: 6px 45px 18px 0;
  font-family: var(--heading-font);
  font-size: 27px;
  line-height: 1.1;
}

.modal-description {
  margin: -9px 0 20px;
  color: var(--muted);
  font-size: 12px;
}

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

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

.form-field.full {
  grid-column: 1 / -1;
}

.form-field label {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 800;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  color: var(--text);
  background: rgba(3, 13, 21, 0.7);
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: 0;
}

.form-field textarea {
  min-height: 92px;
  resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: rgba(34, 211, 238, 0.58);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.06);
}

.form-field small {
  color: var(--muted);
  font-size: 9px;
}

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

.danger-callout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 14px;
  color: #fecdd3;
  background: rgba(159, 18, 57, 0.1);
  border: 1px solid rgba(251, 113, 133, 0.22);
  border-radius: 11px;
}

.danger-callout b {
  font-size: 20px;
}

.danger-callout strong,
.danger-callout small {
  display: block;
}

.danger-callout small {
  margin-top: 3px;
  color: #d8a4ad;
  font-size: 10px;
}

.secret-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin: 18px 0;
  padding: 13px;
  background: rgba(3, 13, 21, 0.78);
  border: 1px solid rgba(34, 211, 238, 0.26);
  border-radius: 11px;
}

.secret-box code {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--cyan-bright);
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 12px;
  user-select: all;
}

.confirm-input {
  margin-top: 15px;
}

.toast-stack {
  position: fixed;
  z-index: 1200;
  display: grid;
  width: min(390px, calc(100vw - 28px));
  gap: 9px;
  right: 14px;
  bottom: 14px;
}

.toast {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  color: var(--text-soft);
  background: rgba(9, 29, 42, 0.96);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.34);
  animation: toast-in 220ms ease both;
}

.toast::before {
  width: 8px;
  height: 8px;
  content: "";
  background: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.65);
}

.toast.success::before {
  background: var(--green);
  box-shadow: 0 0 12px rgba(74, 222, 128, 0.65);
}

.toast.error {
  border-color: rgba(251, 113, 133, 0.3);
}

.toast.error::before {
  background: var(--red);
  box-shadow: 0 0 12px rgba(251, 113, 133, 0.65);
}

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

.toast strong {
  color: var(--text);
  font-size: 11px;
}

.toast small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.toast button {
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 17px;
}

.mobile-scrim {
  position: fixed;
  z-index: 45;
  inset: 0;
  background: rgba(1, 7, 12, 0.66);
  backdrop-filter: blur(4px);
}

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

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

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

@keyframes security-pulse {
  0%, 100% { transform: scale(0.85); opacity: 0.7; }
  50% { transform: scale(1.1); opacity: 1; }
}

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

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

  .account-chip div,
  .connection-state b {
    display: none;
  }
}

@media (max-width: 920px) {
  .login-stage {
    grid-template-columns: 1fr;
  }

  .login-brand {
    display: none;
  }

  .login-panel-wrap {
    padding: 24px;
  }

  .login-atmosphere::before {
    mask-image: none;
  }

  .sidebar {
    transform: translateX(-105%);
    transition: transform 190ms ease;
  }

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

  .workspace {
    margin-left: 0;
  }

  .mobile-menu {
    display: inline-grid;
    place-items: center;
  }

  .loading-state {
    left: 0;
  }

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

@media (max-width: 700px) {
  .topbar {
    gap: 10px;
    padding: 11px 14px;
  }

  .topbar-heading p,
  .refresh-button b,
  .account-chip > div {
    display: none;
  }

  .account-chip {
    padding-left: 0;
    border-left: 0;
  }

  .account-chip button {
    display: none;
  }

  .main-content {
    padding: 21px 14px 34px;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-actions {
    width: 100%;
    justify-content: flex-start;
  }

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

  .form-field.full {
    grid-column: auto;
  }

  .table-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search-box {
    width: 100%;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table thead {
    display: none;
  }

  .data-table tr {
    padding: 10px 13px;
    border-bottom: 1px solid var(--line);
  }

  .data-table tr:last-child {
    border-bottom: 0;
  }

  .data-table td {
    display: grid;
    grid-template-columns: 105px 1fr;
    gap: 10px;
    padding: 7px 0;
    border: 0;
  }

  .data-table td::before {
    content: attr(data-label);
    color: #638792;
    font-family: var(--heading-font);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

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

  .audit-entry {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .modal-card {
    padding: 23px 18px;
  }

  .secret-box {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .login-panel-wrap {
    padding: 14px;
  }

  .login-panel {
    padding: 25px 19px;
  }

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

  .topbar-heading h1 {
    font-size: 17px;
  }
}

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

@media (forced-colors: active) {
  .brand-mark,
  .metric-card,
  .panel,
  .product-card,
  .modal-card,
  .login-panel {
    border: 1px solid CanvasText;
  }
}
