:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #f4f7fb;
  --bg-soft: #eef4fb;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --surface-blue: #eef7ff;
  --sidebar: #071b36;
  --sidebar-2: #09284d;
  --text: #111827;
  --muted: #667085;
  --subtle: #98a2b3;
  --line: #d9e2ec;
  --line-soft: #e8eef5;
  --primary: #1468d8;
  --primary-strong: #0b55bd;
  --primary-soft: #e8f1ff;
  --teal: #20b8c7;
  --green: #16a34a;
  --orange: #d97706;
  --red: #b42318;
  --shadow-sm: 0 1px 2px rgb(16 24 40 / 5%);
  --shadow-md: 0 10px 28px rgb(16 24 40 / 9%);
  --shadow-lg: 0 22px 70px rgb(15 35 70 / 18%);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 84% 0%, rgb(32 184 199 / 8%), transparent 34%),
    linear-gradient(180deg, #f7faff 0%, var(--bg) 42%, #f5f7fb 100%);
  color: var(--text);
  font-size: 14px;
  letter-spacing: 0;
}

[hidden] {
  display: none !important;
}

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

h1 {
  font-size: 28px;
  line-height: 1.18;
  font-weight: 800;
  color: var(--text);
}

h2 {
  font-size: 18px;
  line-height: 1.25;
  font-weight: 800;
  color: var(--text);
}

p {
  color: var(--muted);
  line-height: 1.65;
}

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

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

button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--primary);
  color: #ffffff;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

button:hover,
.button-link:hover {
  background: var(--primary-strong);
  box-shadow: 0 8px 20px rgb(20 104 216 / 20%);
}

button:active,
.button-link:active {
  transform: translateY(1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  box-shadow: none;
}

.button-link.secondary,
.secondary-button,
.ghost-button {
  border-color: var(--line);
  background: var(--surface);
  color: #344054;
}

.button-link.secondary:hover,
.secondary-button:hover,
.ghost-button:hover {
  border-color: #bfd0e4;
  background: #f8fbff;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.danger-button {
  background: #fff5f5;
  border-color: #ffd3d0;
  color: var(--red);
}

.danger-button:hover {
  background: #fee4e2;
  border-color: #fda29b;
  color: #912018;
  box-shadow: none;
}

.icon-button {
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  border-color: var(--line);
  background: var(--surface);
  color: #475467;
  font-size: 21px;
  line-height: 1;
  box-shadow: none;
}

.icon-button:hover {
  background: var(--surface-muted);
  color: var(--text);
}

form,
.console-form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #cfd9e6;
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 1px 1px rgb(16 24 40 / 3%);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

input,
select {
  height: 40px;
  padding: 0 12px;
}

textarea {
  min-height: 92px;
  padding: 10px 12px;
  resize: vertical;
}

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

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  outline: 0;
  box-shadow: 0 0 0 4px rgb(20 104 216 / 12%);
}

.check-row {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 10px;
  color: #475467;
  font-weight: 650;
}

.check-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  box-shadow: none;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.message {
  color: #175cd3;
  font-size: 13px;
  font-weight: 650;
}

.notice {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 13px;
  border: 1px solid #a8dcea;
  border-radius: var(--radius);
  background: #effbff;
  color: #155e75;
}

.notice strong {
  color: #0e7490;
}

code {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #f8fafc;
  color: #233146;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

/* Auth */
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(135deg, rgb(7 27 54 / 94%) 0%, rgb(9 40 77 / 92%) 44%, rgb(244 247 251 / 0%) 44.2%),
    radial-gradient(circle at 88% 18%, rgb(32 184 199 / 14%), transparent 30%),
    var(--bg);
}

.auth-stage {
  width: min(100%, 980px);
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(360px, 460px);
  gap: 28px;
  align-items: center;
}

.auth-brief {
  max-width: 390px;
  color: #ffffff;
  text-shadow: 0 1px 18px rgb(0 0 0 / 18%);
}

.auth-brief-logo {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 24px;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 14px;
  background: rgb(255 255 255 / 12%);
  color: #ffffff;
  font-weight: 950;
  box-shadow: 0 18px 46px rgb(0 0 0 / 20%);
}

.auth-brief h1 {
  max-width: 440px;
  color: #ffffff;
  font-size: 42px;
  letter-spacing: 0;
}

.auth-brief p {
  max-width: 390px;
  margin-top: 14px;
  color: rgb(255 255 255 / 82%);
  font-size: 15px;
}

.auth-brief-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 330px;
  margin-top: 28px;
}

.auth-brief-list span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 999px;
  background: rgb(255 255 255 / 9%);
  color: rgb(255 255 255 / 84%);
  font-size: 12px;
  font-weight: 800;
}

.auth-panel {
  width: min(100%, 460px);
  padding: 30px;
  border: 1px solid rgb(255 255 255 / 70%);
  border-radius: 12px;
  background: rgb(255 255 255 / 92%);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
}

.auth-panel.wide {
  width: min(100%, 660px);
}

.consent-panel {
  width: min(100%, 640px);
  padding: 32px;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 24px;
}

.brand p {
  margin-top: 7px;
  font-size: 14px;
}

.mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0a4fb7, #21b7c6);
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.04em;
  box-shadow: 0 14px 32px rgb(20 104 216 / 24%);
}

.consent-detail {
  display: grid;
  gap: 14px;
}

.consent-summary {
  padding: 14px 16px;
  border: 1px solid #d9e3f0;
  border-radius: var(--radius);
  background: #fbfdff;
}

.consent-summary strong {
  color: var(--text);
}

.consent-summary span {
  color: var(--muted);
}

.consent-fields {
  display: grid;
  gap: 8px;
  margin: 0;
}

.consent-fields > div {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-height: 38px;
  padding: 10px 12px;
  border: 1px solid #d9e3f0;
  border-radius: var(--radius);
  background: #fbfdff;
}

.consent-fields dt {
  color: #344054;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.consent-fields dd {
  min-width: 0;
  margin: 0;
  color: var(--text);
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
}

.scope-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-family: inherit;
}

.scope-pills span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.consent-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}

.consent-actions button {
  min-width: 104px;
}

.auth-form {
  margin: 0;
}

.auth-form button[type="submit"] {
  width: 100%;
  min-height: 42px;
}

.inline-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 10px;
  align-items: end;
}

.auth-switch {
  margin-top: 20px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.auth-switch a {
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

/* Legacy simple pages */
.home {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.home section,
.dashboard-shell {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 32px 24px 48px;
}

.grid-2,
.endpoint-list,
.endpoint-list.compact,
.admin-workspace-grid {
  display: grid;
  gap: 12px;
}

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

.nav-link,
.workspace-link {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-weight: 750;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.eyebrow,
.card-label,
.text-link {
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

/* Console shell */
.console-body {
  min-height: 100vh;
  background: var(--bg);
}

.dashboard-loading {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
}

.console-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.console-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px 14px;
  background:
    linear-gradient(180deg, rgb(12 40 78 / 78%), transparent 38%),
    var(--sidebar);
  color: #ffffff;
  box-shadow: 12px 0 36px rgb(7 27 54 / 16%);
}

.console-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 0 4px 28px;
  color: #ffffff;
  text-decoration: none;
}

.console-brand strong {
  display: block;
  color: #ffffff;
  font-size: 18px;
  font-weight: 850;
  line-height: 1.1;
}

.console-brand small {
  display: block;
  margin-top: 5px;
  color: rgb(255 255 255 / 66%);
  font-size: 12px;
}

.console-logo {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 12px;
  background: linear-gradient(135deg, #ffffff 0%, #cceeff 100%);
  color: #07345f;
  font-size: 13px;
  font-weight: 950;
  box-shadow: 0 12px 30px rgb(0 0 0 / 18%);
}

.console-nav {
  display: grid;
  gap: 5px;
}

.console-nav-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 11px;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: rgb(255 255 255 / 78%);
  font-size: 14px;
  font-weight: 760;
  text-align: left;
  text-decoration: none;
  box-shadow: none;
}

.console-nav-item:hover,
.console-nav-item.active {
  border-color: rgb(255 255 255 / 10%);
  background: linear-gradient(135deg, rgb(20 104 216 / 86%), rgb(26 121 230 / 78%));
  color: #ffffff;
  box-shadow: 0 10px 24px rgb(0 0 0 / 18%);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 20px;
  color: currentColor;
  font-size: 15px;
}

.admin-nav {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgb(255 255 255 / 10%);
}

.admin-nav p {
  margin: 0 0 9px 12px;
  color: rgb(255 255 255 / 42%);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.console-main {
  min-width: 0;
  padding: 0;
}

.console-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  min-height: 78px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 86%);
  backdrop-filter: blur(14px);
}

.console-topbar h1 {
  font-size: 24px;
}

.console-topbar p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.console-top-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 0 10px 0 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: #344054;
  font-size: 13px;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}

.user-avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--teal));
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.console-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(34vw, 360px);
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--subtle);
  box-shadow: var(--shadow-sm);
}

.console-search input {
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 13px;
}

.console-search input:focus {
  box-shadow: none;
}

#view-root {
  display: grid;
  gap: 16px;
  padding: 22px 24px 32px;
}

#dashboard-message {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 80;
  width: min(360px, calc(100vw - 32px));
  min-height: 0;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #b7e4c7;
  border-radius: 8px;
  background: #f0fdf4;
  color: #166534;
  box-shadow: 0 18px 44px rgb(16 24 40 / 18%);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

#dashboard-message.show {
  opacity: 1;
  transform: translateY(0);
}

#dashboard-message[data-type="error"] {
  border-color: #fecaca;
  background: #fff7f7;
  color: #b42318;
}

.loading-error {
  width: min(100%, 480px);
}

/* Dashboard components */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.metric-card {
  position: relative;
  min-height: 122px;
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--primary), var(--teal));
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.metric-card strong {
  display: block;
  margin-top: 12px;
  color: #101828;
  font-size: 30px;
  line-height: 1.05;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.metric-card p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.console-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
  gap: 16px;
  align-items: start;
}

.console-panel,
.dashboard-section,
.dashboard-card,
.client-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.console-panel {
  padding: 18px;
}

.panel-heading,
.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 15px;
}

.panel-heading h2,
.section-heading h2 {
  font-size: 17px;
}

.panel-heading p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.panel-heading > button,
.panel-heading .button-plain {
  white-space: nowrap;
}

.panel-link,
.button-plain {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 13px;
  font-weight: 850;
  box-shadow: none;
}

.panel-link:hover,
.button-plain:hover {
  background: transparent;
  color: var(--primary-strong);
  box-shadow: none;
}

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

.detail-list p {
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 13px;
}

.detail-list strong {
  color: #344054;
  font-size: 12px;
}

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

.operation-list > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.operation-list strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
}

.operation-list p {
  margin-top: 4px;
  font-size: 13px;
}

.security-list,
.activity-list,
.client-list {
  display: grid;
  gap: 10px;
}

.client-list {
  margin-top: 12px;
}

.session-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.session-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
  box-shadow: var(--shadow-sm);
}

.session-main {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.session-main strong {
  display: block;
  color: var(--text);
  font-size: 14px;
}

.session-main span:not(.status-chip) {
  display: block;
  max-width: 720px;
  margin-top: 4px;
  color: var(--subtle);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.session-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.session-meta div {
  padding: 9px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #ffffff;
}

.session-meta dt {
  color: var(--subtle);
  font-size: 11px;
  font-weight: 800;
}

.session-meta dd {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 760;
  overflow-wrap: anywhere;
}

.client-item {
  display: grid;
  gap: 9px;
  padding: 14px;
}

.client-item > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.client-item strong,
.activity-list strong,
.security-list strong {
  color: var(--text);
  font-size: 14px;
}

.client-item p,
.activity-list p,
.security-list p {
  color: var(--muted);
  font-size: 13px;
}

.security-list div {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  column-gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}

.security-list div:last-child,
.activity-list div:last-child {
  border-bottom: 0;
}

.security-list p {
  grid-column: 2;
  margin-top: 4px;
}

.activity-list div {
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}

.status-dot {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 999px;
  background: #b8c2d0;
}

.status-dot.ok {
  background: var(--green);
}

.status-dot.warn {
  background: var(--orange);
}

.status-chip {
  display: inline-grid;
  place-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.status-chip.ok {
  border-color: #b7e4c7;
  background: #ecfdf3;
  color: #067647;
}

.status-chip.neutral {
  border-color: var(--line);
  background: var(--surface-muted);
  color: #475467;
}

/* Tables */
.table-shell {
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  background: var(--surface);
}

th {
  height: 42px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  color: #667085;
  font-size: 12px;
  font-weight: 850;
  text-align: left;
  white-space: nowrap;
}

td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line-soft);
  color: #344054;
  font-size: 13px;
  vertical-align: middle;
}

tbody tr:hover td {
  background: #fbfdff;
}

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

td strong {
  display: block;
  color: #101828;
  font-size: 13px;
  font-weight: 800;
}

td span {
  display: block;
  margin-top: 4px;
  color: var(--subtle);
  font-size: 12px;
}

td code {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 8px;
  border-radius: 7px;
  background: #f8fafc;
  font-size: 12px;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.table-actions button,
.client-item .actions button {
  min-height: 30px;
  padding: 0 9px;
  font-size: 12px;
  box-shadow: none;
}

.table-actions button:not(.danger-button),
.client-item .actions button {
  border-color: var(--line);
  background: var(--surface);
  color: #344054;
}

.table-actions button:not(.danger-button):hover,
.client-item .actions button:hover {
  border-color: #b8cce5;
  background: var(--primary-soft);
  color: var(--primary);
}

.empty-table,
.empty-state {
  color: var(--muted);
  text-align: center;
}

.empty-state {
  padding: 28px;
  border: 1px dashed #c8d4e4;
  border-radius: var(--radius);
  background: #fbfdff;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgb(7 27 54 / 48%);
  backdrop-filter: blur(4px);
}

.modal-panel {
  width: min(100%, 536px);
  max-height: min(720px, calc(100vh - 48px));
  overflow: auto;
  padding: 20px;
  border: 1px solid rgb(255 255 255 / 72%);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.client-detail-modal {
  display: flex;
  flex-direction: column;
  width: min(100%, 880px);
  padding: 18px;
}

.config-list {
  display: grid;
  gap: 6px;
  min-height: 0;
}

.config-field {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 4px;
  align-items: start;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid #d9e3f0;
  border-radius: 7px;
  background: #fbfdff;
}

.config-field.is-copyable {
  cursor: copy;
}

.config-field.is-copyable:hover {
  border-color: #b8cce5;
  background: #f7fbff;
}

.config-field strong {
  display: inline-flex;
  color: #344054;
  font-size: 12px;
  line-height: 1.55;
  white-space: nowrap;
}

.config-field code {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  white-space: normal;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
}

.modal-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.modal-heading h2 {
  font-size: 18px;
}

.modal-heading p {
  margin-top: 3px;
  font-size: 13px;
}

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

  .console-content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .console-layout {
    grid-template-columns: 1fr;
  }

  .console-sidebar {
    position: static;
    height: auto;
  }

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

  .admin-nav {
    margin-top: 16px;
  }

  .console-topbar {
    position: static;
    display: grid;
    align-items: stretch;
  }

  .console-top-actions {
    display: grid;
    grid-template-columns: 1fr auto auto;
  }

  .console-search {
    width: 100%;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 13px;
  }

  .auth-shell {
    padding: 18px;
    background: linear-gradient(180deg, #071b36 0%, #09284d 28%, var(--bg) 28.2%);
  }

  .auth-stage {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .auth-brief {
    padding: 6px 2px 0;
  }

  .auth-brief h1 {
    font-size: 30px;
  }

  .auth-brief p {
    font-size: 14px;
  }

  .auth-panel {
    padding: 22px;
  }

  .inline-fields,
  .grid-2,
  .admin-workspace-grid,
  .metric-grid,
  .console-nav,
  .console-top-actions {
    grid-template-columns: 1fr;
  }

  .console-sidebar,
  .console-topbar,
  #view-root {
    padding-left: 16px;
    padding-right: 16px;
  }

  #view-root {
    padding-top: 16px;
  }

  .panel-heading,
  .section-heading,
  .operation-list > div,
  .client-item > div:first-child {
    display: grid;
  }

  .session-main,
  .session-meta {
    display: grid;
    grid-template-columns: 1fr;
  }

  .modal-backdrop {
    align-items: end;
    padding: 12px;
  }

  .modal-panel {
    max-height: calc(100vh - 24px);
    padding: 18px;
  }
}
