:root {
  --bg: #05070d;
  --bg-soft: #090d18;
  --panel: rgba(13, 18, 32, .82);
  --panel-solid: #0d1220;
  --panel-hover: #11182a;
  --line: rgba(150, 173, 222, .13);
  --line-strong: rgba(99, 221, 255, .24);
  --text: #f4f7ff;
  --muted: #8894ad;
  --muted-2: #59647b;
  --cyan: #37d9ff;
  --cyan-2: #0e9dff;
  --purple: #a66cff;
  --purple-2: #7044ff;
  --green: #45e6a2;
  --red: #ff617f;
  --amber: #ffbd59;
  --shadow: 0 24px 70px rgba(0, 0, 0, .36);
  --radius: 18px;
  --radius-sm: 11px;
  --sidebar: 272px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 92% -10%, rgba(111, 67, 255, .13), transparent 35%),
    radial-gradient(circle at 45% 110%, rgba(24, 181, 255, .08), transparent 40%),
    var(--bg);
  font: 14px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--cyan); text-decoration: none; }
a:hover { color: #8aeaff; }
button { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(28px, 3vw, 42px); line-height: 1.12; letter-spacing: -.035em; }
h2 { margin-bottom: 7px; font-size: 20px; letter-spacing: -.02em; }
h3 { margin-bottom: 5px; }
p { color: var(--muted); }
code { font: 600 12px/1.4 "SFMono-Regular", Consolas, monospace; color: #bbf4ff; }
::selection { color: white; background: rgba(55, 217, 255, .28); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.muted { color: var(--muted); }
.full { width: 100%; }

.ambient {
  position: fixed; z-index: -1; pointer-events: none; filter: blur(90px);
  width: 300px; height: 300px; border-radius: 50%; opacity: .12;
}
.ambient-a { top: -160px; left: 20%; background: var(--cyan); }
.ambient-b { right: -160px; bottom: 10%; background: var(--purple); }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 50;
  width: var(--sidebar); padding: 26px 18px 18px;
  display: flex; flex-direction: column;
  background: rgba(7, 10, 19, .94);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(24px);
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1.1; }
.brand strong { font-size: 18px; letter-spacing: .01em; }
.brand small { margin-top: 4px; color: var(--muted); font-size: 9px; letter-spacing: .14em; text-transform: uppercase; }
.brand-mark {
  position: relative; display: grid; place-items: center; overflow: hidden;
  width: 41px; height: 41px; border-radius: 13px;
  color: white; font: 700 30px/1 Georgia, serif;
  background: linear-gradient(135deg, rgba(55,217,255,.22), rgba(166,108,255,.25));
  border: 1px solid rgba(102,224,255,.3);
  box-shadow: inset 0 0 22px rgba(50,200,255,.12), 0 0 24px rgba(55,217,255,.08);
}
.brand-mark::after { content: ""; position: absolute; inset: -20%; background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.18), transparent 65%); transform: translateX(-100%); animation: brand-shine 7s ease-in-out infinite; }
.brand-mark.large { width: 54px; height: 54px; font-size: 39px; border-radius: 16px; }
@keyframes brand-shine { 0%, 72%, 100% { transform: translateX(-120%); } 82% { transform: translateX(120%); } }

.nav { margin-top: 42px; display: flex; flex: 1; flex-direction: column; gap: 5px; }
.nav-label { margin: 22px 12px 7px; color: var(--muted-2); font-size: 10px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
.nav-label:first-child { margin-top: 0; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 13px;
  min-height: 44px; padding: 0 12px; border-radius: 11px;
  color: #8f9bb3; font-size: 13px; font-weight: 600;
  transition: color .18s, background .18s, transform .18s;
}
.nav-link:hover { color: #e9faff; background: rgba(112, 135, 184, .08); }
.nav-link.active { color: white; background: linear-gradient(90deg, rgba(42,196,255,.13), rgba(122,75,255,.11)); border: 1px solid rgba(78,196,255,.12); }
.nav-link.active::before { content: ""; position: absolute; left: -19px; width: 3px; height: 24px; border-radius: 0 4px 4px 0; background: var(--cyan); box-shadow: 0 0 14px var(--cyan); }
.nav-icon { display: grid; place-items: center; width: 22px; color: #8190ad; font-size: 18px; font-weight: 400; }
.nav-link.active .nav-icon { color: var(--cyan); }
.sidebar-footer { margin-top: 22px; }
.connection-state { display: flex; align-items: center; gap: 8px; padding: 0 10px 14px; color: #718099; font-size: 11px; }
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.connection-state.offline .online-dot { background: var(--red); box-shadow: 0 0 10px var(--red); }
.profile-mini { display: flex; align-items: center; gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.022); }
.avatar { flex: 0 0 auto; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: white; font-size: 13px; font-weight: 800; background: linear-gradient(135deg, #118fd4, #764bea); box-shadow: 0 5px 18px rgba(78,91,245,.22); }
.avatar.large { width: 44px; height: 44px; border-radius: 13px; font-size: 16px; }
.profile-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.profile-copy strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy span { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.icon-button {
  display: inline-grid; place-items: center; flex: 0 0 auto;
  width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 9px;
  color: #91a0bc; background: rgba(255,255,255,.025); cursor: pointer;
  transition: .18s ease;
}
.icon-button:hover { color: white; border-color: rgba(55,217,255,.25); background: rgba(55,217,255,.08); }
.icon-button.danger:hover { color: var(--red); border-color: rgba(255,97,127,.3); background: rgba(255,97,127,.08); }
.mobile-header, .nav-scrim { display: none; }

.main { min-height: 100vh; margin-left: var(--sidebar); padding: 48px clamp(28px, 4vw, 66px) 70px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin: 0 0 30px; }
.page-header p { margin: 0; }
.hero-header { padding-top: 8px; }
.eyebrow { display: block; margin-bottom: 9px; color: var(--cyan); font-size: 10px; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }
.back-link { display: table; margin-bottom: 14px; color: var(--muted); font-size: 12px; }
.back-link:hover { color: white; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 42px; padding: 0 18px; border: 1px solid transparent; border-radius: 11px;
  color: white; font-size: 12px; font-weight: 750; letter-spacing: .01em;
  background: transparent; cursor: pointer; transition: transform .16s, box-shadow .16s, background .16s, border-color .16s;
}
.button:hover { color: white; transform: translateY(-1px); }
.button.primary { color: #031016; background: linear-gradient(120deg, #61e5ff, #26bff6 55%, #8175ff); box-shadow: 0 9px 28px rgba(34,181,240,.18); }
.button.primary:hover { box-shadow: 0 12px 35px rgba(34,181,240,.28); }
.button.secondary { color: #dffaff; border-color: rgba(64,211,255,.25); background: rgba(48,199,246,.09); }
.button.secondary:hover { border-color: rgba(64,211,255,.42); background: rgba(48,199,246,.14); }
.button.ghost { color: #aab5ca; border-color: var(--line); background: rgba(255,255,255,.02); }
.button.ghost:hover { color: white; border-color: rgba(151,170,211,.24); background: rgba(255,255,255,.045); }
.button.small { min-height: 36px; padding-inline: 14px; }
.button:disabled { opacity: .45; cursor: not-allowed; filter: saturate(.35); transform: none; box-shadow: none; }
.text-link { font-size: 12px; font-weight: 700; }

.panel {
  position: relative; overflow: hidden; padding: 24px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(16,22,38,.86), rgba(9,13,24,.8));
  box-shadow: 0 12px 46px rgba(0,0,0,.12);
  backdrop-filter: blur(14px);
}
.panel::before { content: ""; position: absolute; inset: 0 auto auto 8%; width: 55%; height: 1px; background: linear-gradient(90deg, transparent, rgba(101,218,255,.25), transparent); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.panel-header h2 { margin: 0; }
.panel-header > div { display: flex; align-items: center; gap: 13px; }
.panel-header .eyebrow + h2 { margin-top: -4px; }
.content-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
.span-2 { grid-column: span 2; }
.dashboard-grid { align-items: stretch; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card { position: relative; overflow: hidden; display: flex; align-items: center; gap: 16px; min-height: 120px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: rgba(13,18,32,.74); }
.metric-card::after { content: ""; position: absolute; right: -35px; bottom: -45px; width: 100px; height: 100px; border-radius: 50%; filter: blur(28px); opacity: .12; background: var(--accent); }
.metric-card > div:last-child { position: relative; display: flex; flex-direction: column; }
.metric-card span { color: var(--muted); font-size: 11px; }
.metric-card strong { margin: 3px 0 0; font-size: 28px; letter-spacing: -.04em; }
.metric-card small { color: var(--muted-2); font-size: 9px; }
.metric-icon { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent); border-radius: 13px; color: var(--accent); font-size: 19px; background: color-mix(in srgb, var(--accent) 8%, transparent); }
.accent-cyan { --accent: var(--cyan); }.accent-purple { --accent: var(--purple); }.accent-green { --accent: var(--green); }.accent-blue { --accent: #6195ff; }
.compact-metrics { grid-template-columns: repeat(3, minmax(0,1fr)); margin-top: 18px; }
.compact-metrics .metric-card { min-height: 105px; }
.metric-card strong.metric-word { max-width: 220px; font-size: 13px; line-height: 1.35; letter-spacing: 0; overflow-wrap: anywhere; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 12px; color: var(--muted-2); font-size: 9px; font-weight: 800; letter-spacing: .1em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 15px 12px; border-top: 1px solid rgba(151,173,218,.08); color: #aab6cb; font-size: 11px; white-space: nowrap; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: rgba(94,146,199,.035); }
.table-title { display: block; color: #edf6ff; font-size: 12px; font-weight: 720; }
.table-sub { display: block; margin-top: 3px; color: var(--muted-2); font-size: 9px; }
.row-action { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--muted); background: rgba(255,255,255,.025); font-size: 20px; }
.row-action:hover { color: var(--cyan); background: rgba(55,217,255,.08); }
.short-code { display: inline-block; padding: 5px 8px; border: 1px solid rgba(55,217,255,.12); border-radius: 7px; color: #8beaff; background: rgba(55,217,255,.045); letter-spacing: .09em; }
.copy-value { display: flex; align-items: center; gap: 6px; }
.copy-value button { border: 0; color: var(--muted); background: none; cursor: pointer; }
.copy-value button:hover { color: white; }
.status { display: inline-flex; align-items: center; gap: 7px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; color: #97a4ba; font-size: 9px; font-weight: 750; text-transform: uppercase; }
.status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.large { padding: 7px 12px; font-size: 10px; }
.status-completed { color: var(--green); border-color: rgba(69,230,162,.18); background: rgba(69,230,162,.055); }
.status-running { color: var(--cyan); border-color: rgba(55,217,255,.18); background: rgba(55,217,255,.055); }
.status-running i { animation: pulse 1.5s infinite; }
.status-pending, .status-created, .status-ready { color: var(--amber); border-color: rgba(255,189,89,.18); background: rgba(255,189,89,.05); }
.status-cancelled, .status-incomplete, .status-integrity_failed, .status-failed { color: var(--red); border-color: rgba(255,97,127,.18); background: rgba(255,97,127,.05); }
@keyframes pulse { 50% { opacity: .3; box-shadow: 0 0 0 4px rgba(55,217,255,.08); } }
.hit-count { display: inline-grid; place-items: center; min-width: 28px; height: 26px; border-radius: 7px; background: rgba(255,255,255,.035); }
.hit-count.has-hits { color: #eab7ff; background: rgba(166,108,255,.1); }
.progress-cell { display: flex; align-items: center; gap: 9px; min-width: 120px; }
.progress { overflow: hidden; flex: 1; height: 5px; border-radius: 99px; background: rgba(255,255,255,.055); }
.progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan-2), var(--cyan), var(--purple)); box-shadow: 0 0 10px rgba(55,217,255,.3); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.progress i.indeterminate { width: 100% !important; background-size: 220% 100%; animation: progress-flow 1.5s linear infinite; }
@keyframes progress-flow { to { background-position: -220% 0; } }
.progress.large { height: 7px; }
.progress-cell > span { width: 30px; color: var(--muted); font-size: 9px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.search-form { display: flex; align-items: center; gap: 8px; flex: 1; }
.search-form label { flex: 1; max-width: 330px; }
.result-count { color: var(--muted); font-size: 10px; }
.pagination { display: flex; justify-content: center; gap: 5px; margin-top: 22px; }
.pagination a { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); }
.pagination a.active { color: #051017; border-color: transparent; background: var(--cyan); }
.page-current { display: inline-flex; align-items: center; padding-inline: 9px; color: var(--muted); font-size: 9px; }

.form-stack { display: flex; flex-direction: column; gap: 17px; }
.form-grid { display: grid; gap: 14px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.field { display: flex; flex-direction: column; gap: 7px; color: #c8d1e3; font-size: 10px; font-weight: 700; letter-spacing: .02em; }
.field > span:first-child { display: flex; align-items: center; justify-content: space-between; }
.field em { color: var(--muted-2); font-size: 9px; font-style: normal; font-weight: 500; }
.field small { color: var(--muted-2); font-size: 9px; font-weight: 500; }
input, textarea, select {
  width: 100%; min-height: 43px; padding: 0 13px;
  border: 1px solid rgba(144,166,211,.15); border-radius: 10px;
  color: var(--text); background: rgba(4,7,14,.52);
  outline: none; transition: border-color .17s, background .17s, box-shadow .17s;
}
textarea { min-height: 105px; padding-block: 12px; resize: vertical; }
select { width: auto; min-width: 140px; color: #aab5c9; }
input::placeholder, textarea::placeholder { color: #465168; }
input:hover, textarea:hover, select:hover { border-color: rgba(144,166,211,.25); }
input:focus, textarea:focus, select:focus { border-color: rgba(55,217,255,.5); background: rgba(5,10,19,.76); box-shadow: 0 0 0 3px rgba(55,217,255,.07); }
input:disabled { color: var(--muted); background: rgba(255,255,255,.02); }
.key-input { color: #97ecff; font-family: "SFMono-Regular", Consolas, monospace; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.input-action { position: relative; display: block; }
.input-action input { padding-right: 45px; }
.input-action button { position: absolute; inset: 5px 5px 5px auto; width: 34px; border: 0; color: var(--muted); background: transparent; cursor: pointer; }
.input-action button:hover { color: var(--cyan); }
.form-row { display: flex; align-items: center; gap: 16px; }
.form-row.between { justify-content: space-between; }
.form-row a { font-size: 10px; font-weight: 650; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.check { display: flex; align-items: flex-start; gap: 9px; color: #95a1b8; font-size: 10px; font-weight: 500; cursor: pointer; }
.check input { appearance: none; flex: 0 0 auto; width: 16px; min-height: 16px; height: 16px; margin: 1px 0 0; padding: 0; border-radius: 5px; }
.check input:checked { border-color: transparent; background: linear-gradient(135deg, var(--cyan), var(--purple)); box-shadow: inset 0 0 0 3px #0b111d; }
.preference-check { align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.018); }
.preference-check > span { display: flex; flex-direction: column; }
.preference-check strong { color: #dfe8f7; font-size: 10px; }
.preference-check small { color: var(--muted); font-size: 9px; }
.setting-value { margin-bottom: 9px; color: #d9e8f8; font-size: 16px; font-weight: 700; }
fieldset { min-width: 0; }
.consent-box { margin: 4px 0; padding: 16px; border: 1px solid rgba(55,217,255,.13); border-radius: 12px; background: rgba(55,217,255,.035); }
.consent-box legend { padding: 0 6px; color: var(--cyan); font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.consent-box p { margin: 9px 0 0 25px; color: var(--muted-2); font-size: 9px; }

.auth-layout { overflow-x: hidden; }
.auth-main { min-height: 100vh; }
.auth-shell { display: grid; grid-template-columns: minmax(360px, .95fr) minmax(500px, 1.05fr); min-height: 100vh; }
.auth-visual { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; padding: clamp(34px, 5vw, 72px); border-right: 1px solid var(--line); background: linear-gradient(155deg, rgba(16,25,46,.78), rgba(5,8,16,.9)); }
.auth-visual::before {
  content: ""; position: absolute; inset: 5% -20% auto auto; width: 520px; height: 520px; border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 52px, rgba(64,206,255,.055) 53px 54px), radial-gradient(circle, rgba(110,76,255,.2), rgba(23,144,232,.06) 38%, transparent 65%);
  filter: drop-shadow(0 0 50px rgba(55,217,255,.06)); pointer-events: none;
}
.auth-visual::after { content: "∞"; position: absolute; z-index: 0; right: -7%; top: 19%; color: transparent; font: 800 clamp(250px, 34vw, 500px)/1 Georgia, serif; -webkit-text-stroke: 1px rgba(112,217,255,.07); transform: rotate(-8deg); }
.auth-brand, .auth-message, .security-note, .step-list { position: relative; z-index: 1; }
.auth-message { max-width: 570px; margin-block: auto; padding-block: 70px; }
.auth-message h1 { max-width: 540px; font-size: clamp(40px, 5.2vw, 72px); line-height: .99; }
.auth-message h1 span { color: transparent; background: linear-gradient(90deg, var(--cyan), #77bfff 55%, var(--purple)); background-clip: text; -webkit-background-clip: text; }
.auth-message p { max-width: 490px; margin: 22px 0 0; font-size: 15px; }
.security-note { display: flex; align-items: center; gap: 13px; max-width: 410px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 13px; background: rgba(4,8,16,.4); }
.security-note > span { color: var(--cyan); }
.security-note div { display: flex; flex-direction: column; }
.security-note strong { font-size: 10px; }
.security-note small { color: var(--muted); font-size: 9px; }
.step-list { display: flex; gap: 7px; padding: 0; margin: 0; list-style: none; }
.step-list li { display: flex; align-items: center; gap: 7px; color: var(--muted-2); font-size: 9px; }
.step-list li span { display: grid; place-items: center; width: 23px; height: 23px; border: 1px solid var(--line); border-radius: 50%; }
.step-list li.done { color: var(--cyan); }
.step-list li.done span { color: #06151b; border-color: transparent; background: var(--cyan); }
.auth-panel { display: grid; place-items: center; padding: clamp(26px, 5vw, 76px); }
.auth-card { width: min(100%, 440px); }
.auth-card.wide { width: min(100%, 620px); }
.auth-card > h2 { margin-bottom: 7px; font-size: 29px; }
.auth-card > .muted { margin-bottom: 30px; }
.auth-switch { margin: 24px 0 0; color: var(--muted); font-size: 10px; text-align: center; }
.auth-switch a { font-weight: 750; }
.brand.centered { display: flex; width: fit-content; margin: 0 auto 48px; }
.auth-shell.minimal { display: flex; justify-content: center; }
.auth-shell.minimal .auth-panel { width: 100%; }

.workflow { margin: 8px 0 24px; }
.workflow-step { display: flex; align-items: center; gap: 13px; }
.workflow-step > span { display: grid; place-items: center; flex: 0 0 auto; width: 31px; height: 31px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); font-size: 10px; font-weight: 800; background: rgba(255,255,255,.02); }
.workflow-step.done > span { color: #061319; border-color: transparent; background: var(--cyan); box-shadow: 0 0 20px rgba(55,217,255,.17); }
.workflow-step div { display: flex; flex-direction: column; }
.workflow-step strong { font-size: 11px; }
.workflow-step small { color: var(--muted); font-size: 9px; }
.workflow-line { width: 1px; height: 22px; margin: 4px 0 4px 15px; background: var(--line); }
.form-layout { grid-template-columns: minmax(0,1.55fr) minmax(300px,.75fr); }
.form-layout > .panel:first-child { grid-column: span 2; }
.step-badge { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid rgba(55,217,255,.18); border-radius: 10px; color: var(--cyan); font: 700 10px/1 monospace; background: rgba(55,217,255,.06); }
.number-list { padding: 0; margin: 26px 0; list-style: none; }
.number-list li { display: flex; gap: 13px; margin-bottom: 19px; }
.number-list li > span { display: grid; place-items: center; flex: 0 0 auto; width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 9px; color: var(--cyan); font-size: 10px; }
.number-list strong { font-size: 11px; }
.number-list p { margin: 3px 0 0; font-size: 9px; }
.notice { padding: 14px 15px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.02); }
.notice.info { border-color: rgba(55,217,255,.13); background: rgba(55,217,255,.035); }
.notice strong { display: block; margin-bottom: 3px; color: #cdeff8; font-size: 10px; }
.notice p { margin: 0; font-size: 9px; }

.empty-state { display: grid; justify-items: center; padding: 55px 24px; text-align: center; }
.empty-state.compact { padding-block: 34px; }
.empty-state h3 { font-size: 14px; }
.empty-state p { max-width: 340px; margin-bottom: 15px; font-size: 10px; }
.empty-icon { display: grid; place-items: center; width: 43px; height: 43px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 13px; color: var(--cyan); font-size: 17px; background: rgba(55,217,255,.04); }

.detail-hero { display: grid; grid-template-columns: minmax(220px,.7fr) minmax(280px,1fr) minmax(210px,.7fr); align-items: center; gap: 30px; }
.code-block { display: flex; flex-direction: column; }
.code-block > span, .progress-heading span { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.code-block > div { display: flex; align-items: center; gap: 9px; margin: 5px 0; }
.code-block code { color: white; font-size: 24px; letter-spacing: .16em; }
.code-block small, .download-block small { color: var(--muted-2); font-size: 8px; line-height: 1.45; }
.scan-progress { padding-inline: 30px; border-inline: 1px solid var(--line); }
.progress-heading, .progress-meta { display: flex; align-items: center; justify-content: space-between; }
.progress-heading { margin-bottom: 9px; }
.progress-heading strong { color: var(--cyan); font-size: 18px; }
.progress-meta { margin-top: 7px; color: var(--muted-2); font-size: 8px; }
.download-block { display: flex; flex-direction: column; gap: 8px; text-align: center; }
.privacy-chip, .count-pill, .badge, .tag { display: inline-flex; align-items: center; width: fit-content; padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 8px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; background: rgba(255,255,255,.025); }
.privacy-chip { color: var(--green); border-color: rgba(69,230,162,.14); }
.process-name { color: #eaf3ff; font-weight: 650; }

.signatures-layout { grid-template-columns: minmax(0,1.7fr) minmax(270px,.7fr); align-items: start; }
.signature-add { display: flex; align-items: end; gap: 10px; margin: 18px 0; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(3,6,12,.32); }
.signature-add .field { min-width: 170px; }
.signature-add .grow { min-width: 200px; flex: 1; }
.signature-list { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; }
.signature-row { display: flex; align-items: center; gap: 11px; min-height: 64px; padding: 11px 13px; border-top: 1px solid var(--line); }
.signature-row:first-child { border-top: 0; }
.signature-row:hover { background: rgba(255,255,255,.018); }
.signature-status { display: grid; place-items: center; flex: 0 0 auto; width: 22px; height: 22px; border: 1px solid var(--line); border-radius: 7px; }
.signature-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted-2); }
.signature-status.enabled { border-color: rgba(69,230,162,.17); background: rgba(69,230,162,.045); }
.signature-status.enabled i { background: var(--green); box-shadow: 0 0 8px var(--green); }
.signature-main { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.signature-main strong { font-size: 10px; }
.signature-main code { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.mechanism-stack { display: flex; flex-direction: column; gap: 12px; }
.mechanism-card { padding: 18px; }
.mechanism-card.disabled { opacity: .62; }
.mechanism-card h3 { margin-top: 16px; font-size: 13px; }
.mechanism-card p { font-size: 9px; }
.mechanism-top { display: flex; align-items: center; justify-content: space-between; }
.mechanism-icon { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font: 700 11px/1 monospace; background: rgba(255,255,255,.025); }
.mechanism-icon.active { color: var(--cyan); border-color: rgba(55,217,255,.18); background: rgba(55,217,255,.055); }
.badge.soon { color: var(--purple); border-color: rgba(166,108,255,.16); }

.muted { color: var(--muted-2); }
.button.danger-button { color: #ffdce3; border-color: rgba(255,97,127,.25); background: rgba(255,97,127,.08); }
.button.danger-button:hover { border-color: rgba(255,97,127,.42); background: rgba(255,97,127,.14); box-shadow: 0 9px 28px rgba(255,97,127,.1); }
.access-layout { grid-template-columns: minmax(0,1.7fr) minmax(250px,.7fr); align-items: start; margin: 18px 0; }
.access-add { display: flex; align-items: end; gap: 10px; margin-bottom: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(3,6,12,.32); }
.access-add .grow { flex: 1; }
.access-add select { width: 100%; }
.access-list { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; }
.access-row { display: flex; align-items: center; gap: 11px; min-height: 64px; padding: 11px 13px; border-top: 1px solid var(--line); }
.access-row:first-child { border-top: 0; }
.access-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.access-copy strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.access-copy span { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.danger-zone { display: flex; flex-direction: column; justify-content: space-between; gap: 28px; min-height: 230px; border-color: rgba(255,97,127,.16); }
.danger-zone p { font-size: 10px; }
.share-link-box, .share-link-state { display: grid; gap: 9px; }
.share-link-row, .share-link-actions { display: flex; align-items: center; gap: 8px; }
.share-link-row input { min-width: 0; flex: 1; font-family: var(--mono); font-size: 11px; }
.share-link-actions { flex-wrap: wrap; }
.download-card { width: min(100%, 610px); }
.download-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0; }
.download-facts div { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); }
.download-facts span, .download-facts strong { display: block; }
.download-facts span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .12em; }
.download-facts strong { margin-top: 6px; font-size: 11px; }
.consent-check { align-items: flex-start; line-height: 1.5; }
.field-error { color: var(--red); font-size: 10px; }
.team-actions, .inline-form { display: flex; align-items: center; gap: 8px; }
.team-actions { min-width: 360px; }
.inline-form select { min-width: 112px; min-height: 36px; }
.role-badge { display: inline-flex; padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.role-founder { color: #c8b5ff; border-color: rgba(166,108,255,.24); background: rgba(166,108,255,.08); }
.role-admin { color: #8beaff; border-color: rgba(55,217,255,.2); background: rgba(55,217,255,.06); }
.role-analyst { color: #9cf0ca; border-color: rgba(69,230,162,.2); background: rgba(69,230,162,.06); }
.audit-list { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; }
.audit-row { display: flex; align-items: center; gap: 13px; min-height: 78px; padding: 13px 15px; border-top: 1px solid var(--line); }
.audit-row:first-child { border-top: 0; }
.audit-mark { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border: 1px solid rgba(55,217,255,.14); border-radius: 10px; color: var(--cyan); background: rgba(55,217,255,.045); font-size: 11px; font-weight: 800; }
.audit-main { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.audit-main strong { font-size: 11px; }
.audit-main span { color: #aeb9cc; font-size: 9px; }
.audit-main small, .audit-time small { color: var(--muted-2); font-size: 8px; }
.audit-time { display: flex; align-items: flex-end; flex-direction: column; gap: 3px; color: var(--muted); font-size: 9px; text-align: right; }

.settings-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.preference-list { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; }
.preference-list > div { display: flex; align-items: center; gap: 12px; min-height: 66px; padding: 12px 14px; border-top: 1px solid var(--line); }
.preference-list > div:first-child { border-top: 0; }
.preference-list > div > div { flex: 1; display: flex; flex-direction: column; }
.preference-list strong { font-size: 10px; }
.preference-list small { color: var(--muted); font-size: 8px; }
.preference-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: var(--cyan); background: rgba(55,217,255,.05); }
.switch input { display: none; }
.switch span { display: block; width: 34px; height: 19px; border-radius: 99px; background: rgba(255,255,255,.08); }

.flash-stack { position: fixed; z-index: 100; top: 20px; right: 22px; display: flex; flex-direction: column; gap: 8px; width: min(390px, calc(100vw - 40px)); }
.flash { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 10px 12px 10px 15px; border: 1px solid rgba(55,217,255,.18); border-radius: 12px; color: #ddecf9; background: rgba(9,16,27,.96); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.flash-success { border-color: rgba(69,230,162,.22); }.flash-error, .flash-danger { border-color: rgba(255,97,127,.25); }.flash-warning { border-color: rgba(255,189,89,.25); }
.flash button { border: 0; color: var(--muted); background: none; cursor: pointer; font-size: 18px; }
.flash.hiding { opacity: 0; transform: translateY(-8px); transition: .2s; }

.error-page { display: grid; place-items: center; align-content: center; min-height: calc(100vh - 120px); text-align: center; }
.error-code { position: absolute; z-index: -1; color: rgba(76,198,255,.045); font-size: clamp(180px,35vw,480px); font-weight: 900; line-height: .8; }
.error-page p { max-width: 480px; }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .content-grid.dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-grid .span-2 { grid-column: auto; }
  .quick-panel { min-height: 0; }
  .detail-hero { grid-template-columns: 1fr 1.3fr; }
  .download-block { grid-column: span 2; flex-direction: row; align-items: center; }
  .download-block .button { width: auto; flex: 0 0 auto; }
  .download-block small { text-align: left; }
  .signatures-layout { grid-template-columns: 1fr; }
  .signatures-layout .span-2 { grid-column: auto; }
  .mechanism-stack { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
  .access-layout { grid-template-columns: 1fr; }
  .access-layout .span-2 { grid-column: auto; }
}

@media (max-width: 860px) {
  :root { --sidebar: 260px; }
  .sidebar { transform: translateX(-102%); transition: transform .22s ease; box-shadow: 24px 0 70px rgba(0,0,0,.42); }
  body.nav-open .sidebar { transform: translateX(0); }
  .mobile-header { position: sticky; z-index: 40; top: 0; display: flex; align-items: center; justify-content: space-between; height: 64px; padding: 0 20px; border-bottom: 1px solid var(--line); background: rgba(5,8,15,.86); backdrop-filter: blur(20px); }
  .brand.compact .brand-mark { width: 34px; height: 34px; border-radius: 10px; font-size: 25px; }
  .brand.compact strong { font-size: 15px; }
  .menu-toggle { display: grid; }
  .nav-scrim { position: fixed; z-index: 45; inset: 0; border: 0; background: rgba(0,0,0,.56); backdrop-filter: blur(2px); }
  body.nav-open .nav-scrim { display: block; }
  .main { margin-left: 0; padding: 34px 20px 55px; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-panel { min-height: 100vh; }
  .form-layout { grid-template-columns: 1fr; }
  .form-layout > .panel:first-child { grid-column: auto; }
  .info-panel { grid-column: auto; }
}

@media (max-width: 620px) {
  h1 { font-size: 30px; }
  .page-header { align-items: stretch; flex-direction: column; margin-bottom: 22px; }
  .page-header > .button { width: 100%; }
  .metric-grid, .compact-metrics, .settings-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 100px; }
  .settings-grid .span-2 { grid-column: auto; }
  .panel { padding: 18px; border-radius: 15px; }
  .form-grid.two { grid-template-columns: 1fr; }
  .form-row.between { align-items: flex-start; flex-direction: column; }
  .form-actions { align-items: stretch; flex-direction: column-reverse; }
  .form-actions .button { width: 100%; }
  .toolbar, .search-form { align-items: stretch; flex-direction: column; }
  .search-form label, select { width: 100%; max-width: none; }
  .result-count { align-self: flex-end; }
  .detail-hero { grid-template-columns: 1fr; }
  .scan-progress { padding: 20px 0; border-inline: 0; border-block: 1px solid var(--line); }
  .download-block { grid-column: auto; align-items: stretch; flex-direction: column; }
  .download-block .button { width: 100%; }
  .download-block small { text-align: center; }
  .signature-add { align-items: stretch; flex-direction: column; }
  .signature-add .field, .signature-add .grow { min-width: 0; }
  .signature-row { flex-wrap: wrap; }
  .access-add, .access-row, .team-actions, .inline-form, .share-link-row { align-items: stretch; flex-direction: column; }
  .download-facts { grid-template-columns: 1fr; }
  .access-row .avatar { align-self: flex-start; }
  .team-actions { min-width: 0; }
  .audit-row { align-items: flex-start; }
  .audit-time { align-items: flex-start; flex: 0 0 100%; }
  .audit-row { flex-wrap: wrap; }
  .signature-main { flex-basis: calc(100% - 40px); }
  .mechanism-stack { grid-template-columns: 1fr; }
  .auth-panel { padding: 28px 19px; }
  .auth-card > h2 { font-size: 25px; }
}

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