/*
Purpose: protected Nova account/admin/login styling.
Scope: login, app shell, role-specific sidebars, admin/customer/license/profile surfaces,
dialogs, tables, and responsive console layouts.
*/

:root {
  --bg: #070a0f;
  --bg-soft: #091018;
  --panel: rgba(12, 18, 24, 0.88);
  --panel-strong: rgba(8, 13, 18, 0.94);
  --line: #24313b;
  --line-soft: rgba(156, 178, 190, 0.14);
  --text: #edf3f5;
  --muted: #a9b6be;
  --dim: #6e7c85;
  --primary: #35cce6;
  --flow: #7bf5ac;
  --amber: #d8a348;
  --danger: #f0b15b;
  --shadow: rgba(0, 0, 0, 0.42);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  font-family: "Segoe UI Variable", "Segoe UI", sans-serif;
  background:
    linear-gradient(rgba(53, 204, 230, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(53, 204, 230, 0.022) 1px, transparent 1px),
    linear-gradient(180deg, #05080c 0%, #081018 52%, #05080c 100%);
  background-size: 64px 64px, 64px 64px, auto;
  letter-spacing: 0;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(108deg, rgba(53, 204, 230, 0.08), transparent 34%),
    linear-gradient(252deg, rgba(123, 245, 172, 0.07), transparent 40%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

a {
  color: inherit;
}

.account-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: calc(100vh - 76px);
}

body.is-app-mode {
  overflow-x: hidden;
}

body.is-app-mode .account-shell {
  grid-template-rows: auto minmax(0, 1fr);
}

.panel-meta,
.bottom-status,
.tile-index,
.run-table em,
.permission-matrix span,
.view-chip,
.sync-state {
  font-family: "Cascadia Code", Consolas, monospace;
  letter-spacing: 0;
  text-transform: uppercase;
}

.system-dot,
.pulse-dot,
.sync-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--flow);
  box-shadow: 0 0 18px rgba(123, 245, 172, 0.64);
}


.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 560px);
  justify-content: center;
  align-items: start;
  width: min(760px, calc(100% - 48px));
  margin: 0 auto;
  padding: 58px 0 64px;
}

.surface-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(36, 49, 59, 0.9);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(12, 18, 24, 0.82), rgba(6, 10, 15, 0.78)),
    rgba(12, 18, 24, 0.88);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.3);
}

.surface-panel::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(rgba(53, 204, 230, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(53, 204, 230, 0.034) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.32;
}

.surface-panel > * {
  position: relative;
  z-index: 1;
}

.auth-panel {
  display: grid;
  align-content: start;
  min-height: auto;
  padding: 38px 34px;
}

.panel-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  color: var(--amber);
  font-size: 10px;
}

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

h1 {
  max-width: 520px;
  margin-bottom: 16px;
  font-size: 54px;
  font-weight: 260;
  line-height: 0.98;
}

h2 {
  margin-bottom: 12px;
  font-size: 34px;
  font-weight: 300;
  line-height: 1.05;
}

h3 {
  margin-bottom: 9px;
  font-size: 17px;
  font-weight: 650;
}

.lead,
.role-header p,
.role-tile p {
  color: var(--muted);
  line-height: 1.62;
}

.lead {
  max-width: 580px;
  margin-bottom: 28px;
  font-size: 16px;
}

.login-form {
  display: grid;
  gap: 15px;
  margin-top: 8px;
}

.login-form label:not(.check-option) {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.login-form input[type="email"],
.login-form input[name="password"] {
  width: 100%;
  min-width: 0;
  height: 50px;
  padding: 0 15px;
  border: 1px solid rgba(53, 204, 230, 0.2);
  border-radius: 8px;
  color: var(--text);
  background: rgba(5, 8, 12, 0.58);
  outline: none;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease;
}

.login-form input:focus {
  border-color: rgba(53, 204, 230, 0.58);
  background: rgba(8, 13, 18, 0.88);
  box-shadow: 0 0 0 3px rgba(53, 204, 230, 0.1);
}

.input-shell {
  position: relative;
  display: block;
}

.input-shell input {
  padding-right: 96px;
}

.ghost-input-action {
  position: absolute;
  top: 9px;
  right: 9px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(156, 178, 190, 0.16);
  border-radius: 7px;
  color: var(--dim);
  background: rgba(12, 18, 24, 0.74);
  font-size: 12px;
}

.form-row {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: flex-start;
  margin: 3px 0 4px;
  color: var(--muted);
  font-size: 13px;
}

.auth-alert {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid rgba(123, 245, 172, 0.18);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(5, 8, 12, 0.5);
}

.auth-alert--warn {
  border-color: rgba(216, 163, 72, 0.26);
}

.auth-alert p {
  margin: 0;
  line-height: 1.5;
}

.check-option {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  min-height: 32px;
  min-width: 0;
}

.check-option input {
  width: 17px;
  height: 17px;
  accent-color: var(--flow);
}

.action-stack {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.primary-action,
.secondary-action {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  border: 1px solid rgba(53, 204, 230, 0.28);
  border-radius: 8px;
  color: var(--text);
  overflow: hidden;
  text-decoration: none;
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.primary-action {
  gap: 14px;
  background: linear-gradient(135deg, rgba(53, 204, 230, 0.28), rgba(123, 245, 172, 0.1));
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

.secondary-action {
  color: var(--muted);
  background: rgba(12, 18, 24, 0.54);
}

.primary-action:hover,
.secondary-action:hover {
  border-color: rgba(123, 245, 172, 0.5);
  transform: translateY(-1px);
}

.action-mark {
  width: 22px;
  height: 1px;
  background: linear-gradient(90deg, var(--primary), var(--flow));
}

.password-reset-row {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.password-reset-row a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  transition:
    color 180ms ease,
    transform 180ms ease;
}

.password-reset-row a:hover {
  color: var(--primary);
  transform: translateY(-1px);
}

.role-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 680px;
  padding: 28px;
}

.role-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(156, 178, 190, 0.12);
}

.role-header p {
  max-width: 620px;
  margin-bottom: 0;
}

.segmented-control {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  min-width: 180px;
  padding: 4px;
  border: 1px solid rgba(156, 178, 190, 0.16);
  border-radius: 8px;
  background: rgba(5, 8, 12, 0.62);
}

.segmented-control button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
}

.segmented-control button.is-active {
  color: var(--text);
  background: rgba(53, 204, 230, 0.12);
  box-shadow: inset 0 0 0 1px rgba(123, 245, 172, 0.18);
}

.workspace-frame {
  display: grid;
  grid-template-columns: minmax(230px, 0.72fr) minmax(0, 1fr);
  gap: 22px;
  align-items: stretch;
  padding-top: 24px;
}

.preview-media {
  overflow: hidden;
  min-height: 440px;
  border: 1px solid rgba(36, 49, 59, 0.82);
  border-radius: 8px;
  background: #05080c;
}

.preview-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.62;
  transform: scale(1.04);
}

.role-view {
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
}

.view-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}

.view-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(53, 204, 230, 0.24);
  border-radius: 7px;
  color: var(--text);
  background: rgba(53, 204, 230, 0.07);
  font-size: 10px;
}

.sync-state {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--dim);
  font-size: 10px;
  white-space: nowrap;
}

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

.role-tile {
  position: relative;
  min-height: 176px;
  padding: 18px;
  border: 1px solid rgba(36, 49, 59, 0.84);
  border-radius: 8px;
  background: rgba(5, 8, 12, 0.54);
  overflow: hidden;
}

.role-tile::before {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  content: "";
  background: var(--tile-accent, var(--primary));
}

.accent-cyan {
  --tile-accent: linear-gradient(90deg, var(--primary), transparent);
}

.accent-green {
  --tile-accent: linear-gradient(90deg, var(--flow), transparent);
}

.accent-amber {
  --tile-accent: linear-gradient(90deg, var(--amber), transparent);
}

.tile-index {
  display: block;
  margin-bottom: 18px;
  color: var(--flow);
  font-size: 10px;
}

.role-tile p {
  margin-bottom: 0;
  font-size: 13px;
}

.run-table,
.permission-matrix {
  display: grid;
  border: 1px solid rgba(36, 49, 59, 0.8);
  border-radius: 8px;
  background: rgba(5, 8, 12, 0.5);
}

.run-table {
  grid-template-columns: 8px minmax(0, 1fr) auto;
  gap: 0 14px;
  align-items: center;
  padding: 16px;
}

.run-table span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 16px rgba(53, 204, 230, 0.54);
}

.run-table strong,
.run-table em {
  padding: 11px 0;
  border-bottom: 1px solid rgba(156, 178, 190, 0.08);
}

.run-table strong {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
}

.run-table em {
  color: var(--amber);
  font-size: 10px;
  font-style: normal;
}

.permission-matrix {
  grid-template-columns: minmax(80px, 1fr) repeat(4, 26px);
  gap: 10px;
  align-items: center;
  padding: 17px;
}

.permission-matrix span {
  color: var(--muted);
  font-size: 10px;
}

.permission-matrix i {
  width: 9px;
  height: 9px;
  border: 1px solid rgba(156, 178, 190, 0.34);
  border-radius: 50%;
  justify-self: center;
}

.permission-matrix i.is-on {
  border-color: rgba(123, 245, 172, 0.82);
  background: var(--flow);
  box-shadow: 0 0 14px rgba(123, 245, 172, 0.6);
}

.permission-matrix i.is-warn {
  border-color: rgba(216, 163, 72, 0.82);
  background: var(--amber);
  box-shadow: 0 0 14px rgba(216, 163, 72, 0.5);
}

.app-layout {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  width: 100%;
  min-height: calc(100vh - 76px);
  margin: 0;
  padding: 0;
}

.app-sidebar {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 22px;
  min-height: calc(100vh - 76px);
  padding: 28px 24px;
  border-width: 0 1px 0 0;
  border-radius: 0;
  background:
    linear-gradient(135deg, rgba(12, 18, 24, 0.9), rgba(6, 10, 15, 0.84)),
    rgba(12, 18, 24, 0.9);
  box-shadow: none;
}

.sidebar-head {
  display: grid;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(156, 178, 190, 0.12);
}

.panel-meta-label {
  color: var(--amber);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 10px;
  text-transform: uppercase;
}

.sidebar-head strong {
  font-size: 24px;
  font-weight: 320;
}

.sidebar-head span:last-child {
  color: var(--muted);
  font-size: 13px;
}

.sidebar-search {
  display: grid;
  gap: 6px;
  width: min(100%, 176px);
  opacity: 0.88;
}

.sidebar-search label {
  color: var(--dim);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 9px;
  text-transform: uppercase;
}

.sidebar-search input {
  width: 100%;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid rgba(53, 204, 230, 0.12);
  border-radius: 7px;
  color: var(--text);
  font-size: 11px;
  background: rgba(4, 8, 12, 0.22);
  outline: none;
}

.sidebar-search input::placeholder {
  color: rgba(156, 178, 190, 0.48);
}

.sidebar-search input:focus {
  border-color: rgba(123, 245, 172, 0.48);
  box-shadow: 0 0 0 3px rgba(123, 245, 172, 0.08);
}

.app-nav {
  display: grid;
  gap: 8px;
}

.app-nav button,
.app-nav a {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  text-decoration: none;
}

.app-nav button.is-active,
.app-nav button:hover,
.app-nav a.is-active,
.app-nav a:hover {
  border-color: rgba(53, 204, 230, 0.28);
  color: var(--text);
  background: rgba(53, 204, 230, 0.055);
}

.app-nav span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(53, 204, 230, 0.62);
  box-shadow: 0 0 12px rgba(53, 204, 230, 0.3);
}

.app-nav a.is-active span,
.app-nav a:hover span,
.app-nav button.is-active span,
.app-nav button:hover span {
  background: var(--flow);
  box-shadow: 0 0 14px rgba(123, 245, 172, 0.56);
}

.app-nav strong {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 560;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-status {
  align-self: end;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(123, 245, 172, 0.16);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(5, 8, 12, 0.48);
}

.sidebar-status strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 13px;
}

.sidebar-status span:last-child {
  font-size: 12px;
  line-height: 1.45;
}

.sidebar-return {
  width: 100%;
  min-height: 42px;
}

.app-workspace {
  min-height: calc(100vh - 76px);
  padding: 34px;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(135deg, rgba(12, 18, 24, 0.72), rgba(6, 10, 15, 0.7)),
    rgba(12, 18, 24, 0.72);
  box-shadow: none;
}

.workspace-topline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(156, 178, 190, 0.12);
}

.workspace-topline .panel-meta {
  min-height: 16px;
}

.workspace-topline h1 {
  margin-bottom: 12px;
  font-size: 46px;
}

.workspace-topline .lead {
  margin-bottom: 0;
}

.workspace-actions {
  display: grid;
  gap: 10px;
  justify-items: stretch;
  min-width: 210px;
}

.compact-action {
  min-height: 38px;
}

.dashboard-view {
  display: grid;
  gap: 18px;
  padding-top: 24px;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 168px;
  gap: 18px;
  align-items: stretch;
  padding: 20px;
  border: 1px solid rgba(36, 49, 59, 0.82);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(53, 204, 230, 0.08), transparent 42%),
    rgba(5, 8, 12, 0.54);
}

.admin-hero {
  background:
    linear-gradient(135deg, rgba(123, 245, 172, 0.08), transparent 42%),
    rgba(5, 8, 12, 0.54);
}

.dashboard-hero h2 {
  max-width: 760px;
  margin: 16px 0 0;
  font-size: 32px;
}

.health-card {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 128px;
  border: 1px solid rgba(123, 245, 172, 0.18);
  border-radius: 8px;
  background: rgba(5, 8, 12, 0.42);
  text-align: center;
}

.health-card span {
  color: var(--dim);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 10px;
  text-transform: uppercase;
}

.health-card strong {
  color: var(--flow);
  font-size: 38px;
  font-weight: 320;
}

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

.metric-grid article,
.workspace-card {
  border: 1px solid rgba(36, 49, 59, 0.82);
  border-radius: 8px;
  background: rgba(5, 8, 12, 0.54);
}

.metric-grid article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: baseline;
  padding: 16px;
}

.metric-grid span,
.metric-grid em,
.card-head,
.compact-facts span {
  font-family: "Cascadia Code", Consolas, monospace;
  text-transform: uppercase;
}

.metric-grid span {
  color: var(--dim);
  font-size: 10px;
}

.metric-grid strong {
  justify-self: end;
  color: var(--text);
  font-size: 28px;
  font-weight: 320;
}

.metric-grid em {
  grid-column: 1 / -1;
  justify-self: start;
  color: var(--amber);
  font-size: 10px;
  font-style: normal;
  line-height: 1.35;
  white-space: normal;
}

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

.span-2 {
  grid-column: span 2;
}

.workspace-card {
  min-height: 168px;
  padding: 16px;
}

.profile-grid {
  grid-template-columns: minmax(300px, 1.05fr) minmax(260px, 0.75fr);
  align-items: start;
  max-width: 980px;
}

.profile-card {
  min-height: auto;
}

.profile-side-stack {
  display: grid;
  gap: 12px;
}

.avatar-card {
  background:
    radial-gradient(circle at 50% 34%, rgba(53, 204, 230, 0.12), transparent 36%),
    rgba(5, 8, 12, 0.54);
}

.avatar-upload-form {
  display: grid;
  gap: 14px;
}

.avatar-upload-target {
  display: grid;
  gap: 12px;
  justify-items: center;
  cursor: pointer;
}

.avatar-upload-target input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.profile-avatar-large {
  width: 168px;
  height: 168px;
  border: 1px solid rgba(123, 245, 172, 0.26);
  border-radius: 50%;
  object-fit: cover;
  background: rgba(3, 7, 11, 0.8);
  box-shadow:
    0 0 0 10px rgba(53, 204, 230, 0.035),
    0 18px 48px rgba(0, 0, 0, 0.34);
}

.avatar-upload-target:hover .profile-avatar-large,
.avatar-upload-target:focus-within .profile-avatar-large {
  border-color: rgba(123, 245, 172, 0.5);
  box-shadow:
    0 0 0 10px rgba(123, 245, 172, 0.045),
    0 18px 48px rgba(0, 0, 0, 0.34);
}

.avatar-upload-target span {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.profile-license-card {
  background:
    linear-gradient(135deg, rgba(53, 204, 230, 0.06), transparent 44%),
    rgba(5, 8, 12, 0.54);
}

.profile-card-action {
  width: 100%;
  margin-top: 16px;
}

.card-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 10px;
}

.card-head em {
  color: var(--amber);
  font-style: normal;
}

.project-list,
.admin-table,
.audit-stream,
.compact-facts,
.migration-table {
  display: grid;
  gap: 10px;
}

.project-list div,
.admin-table div,
.audit-stream div,
.compact-facts div,
.migration-table div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 14px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid rgba(156, 178, 190, 0.1);
}

.project-list strong,
.admin-table strong,
.audit-stream strong,
.compact-facts strong,
.migration-table strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-list span,
.admin-table span,
.migration-table span {
  grid-column: 1;
  color: var(--muted);
  font-size: 12px;
}

.project-list em,
.admin-table em,
.audit-stream em,
.migration-table em {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: var(--flow);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 10px;
  font-style: normal;
}

.migration-table .migration-row.is-pending {
  margin: 2px -10px 0;
  padding: 12px 10px;
  border: 1px solid rgba(216, 163, 72, 0.28);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(216, 163, 72, 0.12), rgba(216, 163, 72, 0.03));
}

.migration-table .migration-row.is-pending strong,
.migration-table .migration-row.is-pending em {
  color: var(--amber);
}

.migration-table .migration-row.is-applied em {
  color: var(--flow);
}

.signal-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.signal-list li {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.signal-list li span,
.audit-stream span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 14px rgba(53, 204, 230, 0.54);
}

.timeline-track {
  position: relative;
  height: 96px;
  border: 1px solid rgba(156, 178, 190, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(rgba(53, 204, 230, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(53, 204, 230, 0.025) 1px, transparent 1px),
    rgba(5, 8, 12, 0.35);
  background-size: 32px 32px, 32px 32px, auto;
}

.timeline-track::before {
  position: absolute;
  top: 50%;
  right: 18px;
  left: 18px;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, var(--primary), var(--flow), var(--amber));
}

.timeline-track span {
  position: absolute;
  top: calc(50% - 5px);
  left: var(--i);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--flow);
  box-shadow: 0 0 16px rgba(123, 245, 172, 0.64);
}

.compact-facts div {
  grid-template-columns: minmax(0, 1fr) auto;
}

.migration-card {
  grid-column: span 2;
}

.migration-table--compact {
  margin-top: 18px;
}

.card-copy {
  margin-bottom: 16px;
  color: var(--muted);
  line-height: 1.55;
}

.toast-stack {
  display: grid;
  justify-items: end;
  margin: 18px 0 0;
}

.system-toast {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  width: min(420px, 100%);
  padding: 13px 14px;
  border: 1px solid rgba(123, 245, 172, 0.2);
  border-radius: 8px;
  color: var(--muted);
  background:
    linear-gradient(135deg, rgba(9, 16, 24, 0.96), rgba(5, 8, 12, 0.92)),
    rgba(8, 13, 18, 0.94);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.28);
}

.system-toast--warn {
  border-color: rgba(216, 163, 72, 0.38);
}

.system-toast p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

.compact-facts span {
  color: var(--dim);
  font-size: 10px;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.field-stack {
  display: grid;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.field-stack span,
.setup-facts span {
  color: var(--dim);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 10px;
  text-transform: uppercase;
}

.field-stack input,
.field-stack select,
.field-stack textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(53, 204, 230, 0.2);
  border-radius: 8px;
  color: var(--text);
  background: rgba(5, 8, 12, 0.58);
  outline: none;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease;
}

.field-stack input,
.field-stack select {
  height: 42px;
  padding: 0 12px;
}

.field-stack textarea {
  min-height: 74px;
  resize: vertical;
  padding: 11px 12px;
  line-height: 1.45;
}

.field-stack input:focus,
.field-stack select:focus,
.field-stack textarea:focus {
  border-color: rgba(53, 204, 230, 0.58);
  background: rgba(8, 13, 18, 0.88);
  box-shadow: 0 0 0 3px rgba(53, 204, 230, 0.1);
}

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

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

.form-actions .compact-action {
  min-width: 180px;
}

.admin-list {
  display: grid;
  gap: 12px;
}

.admin-list-row,
.activation-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) repeat(3, minmax(120px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  padding: 14px 0;
  border-top: 1px solid rgba(156, 178, 190, 0.1);
}

.admin-list-row .span-form {
  grid-column: 1 / -2;
}

.row-main {
  display: grid;
  gap: 5px;
  min-width: 0;
  align-self: center;
}

.row-main strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-main span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
}

.inline-form {
  display: flex;
  justify-content: flex-end;
}

.admin-check {
  align-self: center;
  margin-bottom: 4px;
}

.customer-admin-workspace .workspace-topline {
  width: min(100%, 720px);
  padding-bottom: 18px;
}

.customer-admin-workspace .workspace-topline h1 {
  margin-bottom: 8px;
  font-size: 38px;
}

.customer-admin-workspace .workspace-topline .lead {
  max-width: 540px;
  font-size: 14px;
  line-height: 1.55;
}

.customer-admin-workspace .dashboard-view {
  width: min(100%, 960px);
  gap: 14px;
  padding-top: 18px;
}

.customer-control-bar {
  display: flex;
  gap: 10px;
  align-items: end;
  justify-content: flex-start;
  width: 100%;
}

.customer-search-form {
  display: flex;
  flex: 0 1 430px;
  gap: 8px;
  align-items: end;
  max-width: 430px;
}

.customer-search-form .field-stack {
  flex: 0 1 286px;
  gap: 6px;
  max-width: 286px;
}

.customer-search-form .field-stack input {
  height: 36px;
  padding: 0 10px;
  font-size: 12px;
  background: rgba(5, 8, 12, 0.42);
}

.customer-search-form .field-stack input::placeholder {
  color: rgba(169, 182, 190, 0.55);
}

.customer-search-form .compact-action {
  flex: 0 0 auto;
  min-width: 92px;
  min-height: 36px;
  padding-inline: 14px;
  font-size: 12px;
}

.customer-create-button {
  flex: 0 0 auto;
  min-width: 154px;
  min-height: 36px;
  padding-inline: 14px;
  font-size: 12px;
}

.customer-list-card {
  width: 100%;
  min-height: auto;
}

.customer-list {
  display: grid;
  gap: 10px;
}

.customer-list-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.3fr) minmax(180px, 1fr) 96px 96px auto auto;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid rgba(156, 178, 190, 0.1);
}

.customer-primary,
.customer-meta {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.customer-primary strong,
.customer-meta strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-primary span,
.customer-meta span {
  min-width: 0;
  overflow: hidden;
  color: var(--dim);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 10px;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.pagination {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(156, 178, 190, 0.1);
}

.pagination > span {
  color: var(--muted);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 11px;
}

.is-disabled {
  pointer-events: none;
  opacity: 0.45;
}

.modal-dialog {
  width: min(720px, calc(100% - 32px));
  padding: 0;
  border: 1px solid rgba(53, 204, 230, 0.22);
  border-radius: 8px;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(12, 18, 24, 0.98), rgba(5, 8, 12, 0.98)),
    rgba(5, 8, 12, 0.98);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
}

.modal-dialog::backdrop {
  background: rgba(2, 5, 8, 0.72);
  backdrop-filter: blur(8px);
}

.modal-panel {
  display: grid;
  gap: 20px;
  padding: 24px;
}

.modal-head {
  display: flex;
  gap: 16px;
  align-items: start;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(156, 178, 190, 0.12);
}

.modal-head h2 {
  margin: 8px 0 0;
}

.modal-close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(156, 178, 190, 0.16);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(5, 8, 12, 0.5);
  font-size: 20px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.avatar-crop-dialog {
  width: min(560px, calc(100% - 32px));
}

.avatar-crop-panel {
  gap: 18px;
}

.avatar-crop-stage {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid rgba(36, 49, 59, 0.84);
  border-radius: 8px;
  background: #03060a;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.avatar-crop-stage:active {
  cursor: grabbing;
}

.avatar-crop-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.avatar-crop-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.avatar-crop-frame::before {
  position: absolute;
  inset: 0;
  content: "";
  background: rgba(5, 8, 12, 0.62);
  -webkit-mask: radial-gradient(circle at center, transparent 49.6%, #000 50%);
  mask: radial-gradient(circle at center, transparent 49.6%, #000 50%);
}

.avatar-crop-frame::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(100% - 2px);
  height: calc(100% - 2px);
  border: 1px solid rgba(123, 245, 172, 0.42);
  border-radius: 50%;
  content: "";
  transform: translate(-50%, -50%);
}

.avatar-crop-controls {
  display: grid;
  gap: 10px;
}

.avatar-crop-zoom {
  display: grid;
  gap: 6px;
}

.avatar-crop-zoom input[type="range"] {
  width: 100%;
  accent-color: var(--flow);
}

.avatar-crop-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.avatar-upload-error {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(216, 163, 72, 0.42);
  border-radius: 8px;
  color: var(--amber);
  background: rgba(216, 163, 72, 0.08);
  font-size: 13px;
  line-height: 1.45;
}

.avatar-upload-error[hidden] {
  display: none !important;
}

.avatar-remove-form {
  margin: 10px 0 0;
}

.avatar-remove-form .profile-card-action {
  margin-top: 0;
}

.customer-profile-grid {
  align-items: start;
}

.token-box {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 14px;
  border: 1px solid rgba(216, 163, 72, 0.3);
  border-radius: 8px;
  background: rgba(5, 8, 12, 0.56);
}

.token-box span {
  color: var(--muted);
  font-size: 13px;
}

.token-box code {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--flow);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(53, 204, 230, 0.2);
  border-radius: 7px;
  color: var(--muted);
  background: rgba(53, 204, 230, 0.06);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 10px;
  text-transform: uppercase;
}

.status-pill--active {
  border-color: rgba(123, 245, 172, 0.24);
  color: var(--flow);
  background: rgba(123, 245, 172, 0.06);
}

.status-pill--suspended {
  border-color: rgba(216, 163, 72, 0.32);
  color: var(--amber);
  background: rgba(216, 163, 72, 0.07);
}

.status-pill--archived {
  opacity: 0.68;
}

.empty-state {
  padding: 16px 0;
  border-top: 1px solid rgba(156, 178, 190, 0.1);
  color: var(--muted);
  font-size: 13px;
}

.setup-facts {
  margin-bottom: 18px;
  padding: 12px 0;
  border-top: 1px solid rgba(156, 178, 190, 0.1);
  border-bottom: 1px solid rgba(156, 178, 190, 0.1);
}

.audit-stream div {
  grid-template-columns: 8px minmax(0, 1fr) auto;
}

.audit-stream strong {
  color: var(--muted);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 12px;
}

.bottom-status {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px 18px;
  color: var(--dim);
  font-size: 10px;
}

.bottom-status span {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.bottom-status span + span::before {
  width: 16px;
  height: 1px;
  margin-right: 18px;
  content: "";
  background: rgba(156, 178, 190, 0.18);
}

body.is-app-mode .bottom-status {
  display: none;
}

@media (prefers-reduced-motion: no-preference) {
  .primary-action:hover .action-mark {
    transform: translateX(3px);
  }

  .action-mark,
  .role-view,
  .segmented-control button {
    transition:
      opacity 180ms ease,
      transform 180ms ease,
      background-color 180ms ease,
      border-color 180ms ease,
      color 180ms ease;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 1120px) {
  .login-layout {
    grid-template-columns: 1fr;
    max-width: 820px;
  }

  .auth-panel,
  .role-panel {
    min-height: auto;
  }

  .app-layout {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: none;
  }

  .app-sidebar {
    grid-template-rows: auto auto auto;
    min-height: auto;
    border-width: 0 0 1px;
  }

  .app-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .sidebar-status {
    align-self: stretch;
  }
}

@media (max-width: 760px) {
  .login-layout {
    width: min(100% - 32px, 620px);
    padding: 28px 0;
  }

  .auth-panel,
  .role-panel {
    padding: 22px;
  }

  h1 {
    font-size: 40px;
  }

  h2 {
    font-size: 28px;
  }

  .role-header,
  .workspace-frame,
  .workspace-topline,
  .dashboard-hero {
    grid-template-columns: 1fr;
  }

  .preview-media {
    min-height: 220px;
  }

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

  .span-2 {
    grid-column: auto;
  }

  .app-layout {
    width: 100%;
    padding: 0;
  }

  .app-sidebar,
  .app-workspace {
    padding: 22px;
  }

  .app-workspace {
    min-height: auto;
  }

  .app-nav {
    grid-template-columns: 1fr 1fr;
  }

  .workspace-actions {
    min-width: 0;
  }

  .customer-admin-workspace .workspace-topline,
  .customer-admin-workspace .dashboard-view,
  .customer-control-bar,
  .customer-list-card {
    width: 100%;
    max-width: none;
  }

  .customer-control-bar,
  .customer-search-form {
    align-items: stretch;
    flex-direction: column;
  }

  .customer-search-form,
  .customer-search-form .field-stack {
    flex: 0 1 auto;
    max-width: none;
  }

  .customer-search-form .field-stack {
    flex: 0 1 auto;
  }

  .customer-search-form .compact-action {
    width: 100%;
  }

  .dashboard-hero h2 {
    font-size: 25px;
  }

  .admin-list-row,
  .activation-row,
  .customer-list-row {
    grid-template-columns: 1fr;
  }

  .admin-list-row .span-form {
    grid-column: auto;
  }

  .row-actions,
  .inline-form,
  .form-actions,
  .modal-actions,
  .pagination {
    justify-content: stretch;
  }

  .row-actions .compact-action,
  .inline-form .compact-action,
  .form-actions .compact-action,
  .modal-actions .compact-action,
  .pagination .compact-action,
  .customer-create-button {
    width: 100%;
  }

  .pagination {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .form-row,
  .view-toolbar,
  .bottom-status {
    align-items: flex-start;
    flex-direction: column;
  }

  .bottom-status {
    gap: 8px;
  }

  .bottom-status span + span::before {
    content: none;
  }

  .segmented-control {
    width: 100%;
  }

  .app-nav {
    grid-template-columns: 1fr;
  }

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

  .metric-grid em {
    justify-self: start;
  }
}
