
:root {
  color-scheme: light;
  --bg: #f2f5f1;
  --surface: #ffffff;
  --surface-quiet: #f6f8f4;
  --rail: #0f2019;
  --rail-line: rgba(233, 242, 238, 0.12);
  --rail-text: #e9f2ee;
  --rail-muted: #8aa89b;
  --ink: #182420;
  --muted: #5f6f66;
  --line: #dbe2da;
  --line-strong: #c3cfc2;
  --accent: #0b8a5c;
  --accent-strong: #076b46;
  --accent-soft: #e2f2e9;
  --accent-ring: rgba(11, 138, 92, 0.26);
  --info: #275fd3;
  --info-soft: #ecf2fd;
  --info-line: #c4d6f7;
  --success: #12784a;
  --success-soft: #e3f4e9;
  --success-line: #bce4c9;
  --warning: #935f0a;
  --warning-soft: #fcf3de;
  --warning-line: #eed9a4;
  --danger: #bb3028;
  --danger-soft: #fdedeb;
  --danger-line: #f3c4bf;
  --shadow-card:
    0 1px 2px rgba(24, 36, 32, 0.05), 0 12px 32px -16px rgba(24, 36, 32, 0.18);
  --shadow-raised:
    0 2px 4px rgba(24, 36, 32, 0.06), 0 18px 44px -18px rgba(24, 36, 32, 0.28);
  --shadow-pop: 0 28px 80px -20px rgba(10, 26, 20, 0.5);
  --radius-card: 12px;
  --radius-control: 8px;
  --font-ui:
    Inter, "SF Pro Text", system-ui, -apple-system, "Segoe UI", Roboto,
    sans-serif;
  --font-mono:
    ui-monospace, "SF Mono", SFMono-Regular, "Cascadia Code", Menlo, Consolas,
    monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

::selection {
  background: var(--accent-soft);
}

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

button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  padding: 0 14px;
  font-weight: 600;
  transition:
    border-color 140ms ease,
    background-color 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

button:hover,
button:focus-visible {
  border-color: var(--accent);
  color: var(--accent-strong);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--accent-ring);
  outline-offset: 2px;
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

h1,
h2,
h3 {
  margin: 0;
}

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

.console-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 16px 20px;
  background:
    radial-gradient(
      120% 60% at 0% 0%,
      rgba(24, 74, 55, 0.55) 0%,
      rgba(24, 74, 55, 0) 60%
    ),
    linear-gradient(180deg, #13251e 0%, var(--rail) 100%);
  color: var(--rail-text);
}

.brand-block {
  padding: 0 8px;
}

.console-kicker {
  margin: 0 0 6px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.console-sidebar .console-kicker {
  color: var(--rail-muted);
}

h1 {
  max-width: 210px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 25px;
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.health-beacon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 5px 11px;
  border: 1px solid var(--rail-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--rail-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.beacon-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6b7f77;
}

.health-beacon[data-state="ok"] {
  border-color: rgba(47, 208, 139, 0.3);
  color: #a9d9c3;
}

.health-beacon[data-state="ok"] .beacon-dot {
  background: #2fd08b;
  animation: beacon-pulse 2.4s ease-out infinite;
}

.health-beacon[data-state="down"] {
  border-color: rgba(255, 125, 112, 0.32);
  color: #f3b3ab;
}

.health-beacon[data-state="down"] .beacon-dot {
  background: #ff7d70;
}

@keyframes beacon-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(47, 208, 139, 0.45);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(47, 208, 139, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(47, 208, 139, 0);
  }
}

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

.nav-group-label {
  margin: 16px 10px 5px;
  color: var(--rail-muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.console-nav .nav-group-label:first-child {
  margin-top: 2px;
}

.nav-button {
  position: relative;
  width: 100%;
  min-height: 38px;
  justify-content: flex-start;
  gap: 10px;
  border-color: transparent;
  border-radius: 8px;
  background: transparent;
  color: #c6d6cd;
  padding: 0 10px;
  font-weight: 500;
  text-align: left;
}

.nav-icon {
  display: inline-flex;
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--rail-muted);
  transition: color 140ms ease;
}

.nav-icon svg {
  width: 100%;
  height: 100%;
}

.nav-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-badge {
  flex: none;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #dfeae4;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.6;
  text-align: center;
}

.nav-badge.warning {
  background: rgba(240, 177, 62, 0.2);
  color: #f4c877;
}

.nav-badge.danger {
  background: rgba(255, 118, 103, 0.22);
  color: #ffa79c;
}

.nav-badge[hidden] {
  display: none;
}

.nav-button:hover,
.nav-button:focus-visible {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.nav-button:focus-visible {
  outline-color: rgba(47, 208, 139, 0.5);
}

.nav-button[aria-current="page"] {
  border-color: rgba(23, 197, 132, 0.26);
  background: linear-gradient(
    90deg,
    rgba(23, 197, 132, 0.16),
    rgba(23, 197, 132, 0.05)
  );
  color: #ffffff;
  font-weight: 600;
}

.nav-button[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 999px;
  background: #17c584;
  box-shadow: 0 0 12px rgba(23, 197, 132, 0.7);
}

.nav-button[aria-current="page"] .nav-icon {
  color: #2fd08b;
}

.sidebar-note {
  margin: auto 8px 0;
  padding-top: 16px;
  border-top: 1px solid var(--rail-line);
  color: var(--rail-muted);
  font-size: 12px;
  line-height: 1.55;
}

.console-workspace {
  min-width: 0;
  padding: 28px 32px 48px;
}

.console-header {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 24px;
  align-items: start;
  margin: 0 0 20px;
}

.workspace-title .console-kicker {
  color: var(--accent-strong);
}

.section-description {
  max-width: 560px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
}

.token-toolbar {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.token-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 0 11px;
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.token-status::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-strong);
}

.token-status[data-state="set"] {
  border-color: var(--success-line);
  background: var(--success-soft);
  color: var(--success);
}

.token-status[data-state="set"]::before {
  background: var(--success);
}

.clear-token,
.dialog-close {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.clear-token:hover,
.clear-token:focus-visible,
.dialog-close:hover,
.dialog-close:focus-visible {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.console-panel {
  min-width: 0;
}

.panel-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  padding: 10px 10px 10px 16px;
}

.panel-status {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.last-updated {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.01em;
}

.auto-refresh-field {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  user-select: none;
}

.auto-refresh-field input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.auto-refresh-field[hidden] {
  display: none;
}

#refresh-view {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  padding: 0 16px;
}

#refresh-view:hover,
#refresh-view:focus-visible {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  color: #ffffff;
}

.filter-region {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  padding: 14px 16px;
}

.filter-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto auto;
  gap: 10px;
  align-items: end;
}

.token-field,
.filter-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.token-field input,
.filter-field input,
.filter-field select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  padding: 0 11px;
  font-weight: 400;
  transition: border-color 140ms ease;
}

.token-field input:hover,
.filter-field input:hover,
.filter-field select:hover {
  border-color: var(--accent);
}

.state-panel {
  min-height: 240px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 4px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  padding: 36px 28px;
  text-align: center;
}

.state-panel[hidden],
.dashboard-content[hidden],
.filter-region[hidden] {
  display: none;
}

.state-glyph {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-quiet);
  color: var(--muted);
}

.state-glyph svg {
  width: 20px;
  height: 20px;
}

.state-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.state-detail {
  max-width: 560px;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
}

.state-actions {
  margin-top: 14px;
}

.skeleton-stack {
  width: min(520px, 72vw);
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.skeleton-bar {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, #edf1eb 25%, #e0e7df 37%, #edf1eb 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

.skeleton-bar:nth-child(2) {
  width: 82%;
}

.skeleton-bar:nth-child(3) {
  width: 64%;
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}

.state-panel.loading .state-title {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.state-panel.empty .state-title {
  color: var(--ink);
}

.state-panel.error .state-title {
  color: var(--danger);
}

.state-panel.error .state-glyph {
  border-color: var(--danger-line);
  background: var(--danger-soft);
  color: var(--danger);
}

.state-panel.unauthorized .state-title {
  color: var(--warning);
}

.state-panel.unauthorized .state-glyph {
  border-color: var(--warning-line);
  background: var(--warning-soft);
  color: var(--warning);
}

.dashboard-content {
  display: grid;
  gap: 16px;
  margin-top: 12px;
  animation: rise-in 260ms ease-out;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

.metric-card {
  position: relative;
  min-height: 122px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  padding: 14px 16px 12px;
  text-align: left;
  cursor: default;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.metric-card::before {
  content: "";
  position: absolute;
  top: 16px;
  right: 16px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
}

.metric-card.success::before {
  background: var(--success);
}

.metric-card.info::before {
  background: var(--info);
}

.metric-card.warning::before {
  background: var(--warning);
}

.metric-card.danger::before {
  background: var(--danger);
}

.metric-label {
  margin: 0;
  padding-right: 20px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.015em;
}

.metric-value {
  margin: 6px 0 0;
  color: var(--ink);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.metric-detail {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.45;
}

.metric-card.success .metric-value {
  color: var(--success);
}

.metric-card.info .metric-value {
  color: var(--info);
}

.metric-card.warning .metric-value {
  color: var(--warning);
}

.metric-card.danger .metric-value {
  color: var(--danger);
}

button.metric-card {
  height: auto;
}

.metric-link {
  cursor: pointer;
}

.metric-link:hover,
.metric-link:focus-visible {
  border-color: var(--accent);
  box-shadow: var(--shadow-raised);
  color: inherit;
  transform: translateY(-1px);
}

.metric-cta {
  margin-top: auto;
  padding-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  transition: color 140ms ease;
}

.metric-cta::after {
  content: " \2192";
}

.metric-link:hover .metric-cta,
.metric-link:focus-visible .metric-cta {
  color: var(--accent-strong);
}

.content-section {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-top: 6px;
}

.section-meta {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-quiet);
  color: var(--muted);
  padding: 1px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 760px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid var(--line);
  background: var(--surface-quiet);
  color: var(--muted);
  padding: 10px 14px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

tbody tr {
  transition: background-color 100ms ease;
}

tbody tr:hover {
  background: #f7faf6;
}

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

.cell-stack {
  display: grid;
  gap: 4px;
}

.cell-primary {
  color: var(--ink);
  font-weight: 600;
}

.cell-secondary {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.cell-stack[title] .cell-primary,
.cell-stack[title] .cell-secondary {
  white-space: nowrap;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  min-height: 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-quiet);
  color: var(--muted);
  padding: 1px 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-chip::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line-strong);
}

.status-chip.success {
  border-color: var(--success-line);
  background: var(--success-soft);
  color: var(--success);
}

.status-chip.success::before {
  background: var(--success);
}

.status-chip.info {
  border-color: var(--info-line);
  background: var(--info-soft);
  color: var(--info);
}

.status-chip.info::before {
  background: var(--info);
}

.status-chip.warning {
  border-color: var(--warning-line);
  background: var(--warning-soft);
  color: var(--warning);
}

.status-chip.warning::before {
  background: var(--warning);
}

.status-chip.danger {
  border-color: var(--danger-line);
  background: var(--danger-soft);
  color: var(--danger);
}

.status-chip.danger::before {
  background: var(--danger);
}

.warning-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.5;
}

.notice-panel {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  padding: 12px 16px;
}

.notice-panel.success {
  border-color: var(--success-line);
  border-left-color: var(--success);
  background: var(--success-soft);
}

.notice-panel.info {
  border-color: var(--info-line);
  border-left-color: var(--info);
  background: var(--info-soft);
}

.notice-panel.warning {
  border-color: var(--warning-line);
  border-left-color: var(--warning);
  background: var(--warning-soft);
}

.notice-panel.danger {
  border-color: var(--danger-line);
  border-left-color: var(--danger);
  background: var(--danger-soft);
}

.notice-title {
  margin: 0;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 700;
}

.notice-detail {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.editor-panel,
.management-form {
  display: grid;
  gap: 14px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  padding: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
  align-items: start;
}

.form-grid.compact {
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  align-items: end;
}

.form-grid > button {
  justify-self: start;
  min-width: 140px;
}

.form-field,
.inline-edit-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.form-field.full-width,
.inline-edit-field.full-width {
  grid-column: 1 / -1;
}

.form-field input,
.form-field select,
.form-field textarea,
.inline-edit-field input,
.inline-edit-field select,
.inline-edit-field textarea {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  padding: 8px 11px;
  font-weight: 400;
  transition: border-color 140ms ease;
}

.form-field input:hover,
.form-field select:hover,
.form-field textarea:hover,
.inline-edit-field input:hover,
.inline-edit-field select:hover,
.inline-edit-field textarea:hover {
  border-color: var(--accent);
}

.form-field textarea,
.inline-edit-field textarea {
  min-height: 76px;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.5;
}

.form-field input[type="checkbox"] {
  width: 16px;
  min-height: 16px;
  padding: 0;
  accent-color: var(--accent);
}

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

.form-actions {
  justify-content: flex-end;
}

.primary-action {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.primary-action:hover,
.primary-action:focus-visible {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  color: #ffffff;
}

.danger-action {
  border-color: var(--danger-line);
  background: var(--danger-soft);
  color: var(--danger);
}

.danger-action:hover,
.danger-action:focus-visible {
  border-color: var(--danger);
  color: var(--danger);
}

.action-status {
  min-height: 20px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.5;
}

.action-status.success {
  color: var(--success);
}

.action-status.error {
  color: var(--danger);
}

.inline-edit-form {
  display: grid;
  gap: 10px;
  min-width: 260px;
}

td details {
  margin-top: 8px;
}

td summary {
  cursor: pointer;
  color: var(--accent-strong);
}

td pre {
  max-width: 360px;
  max-height: 220px;
  margin: 8px 0 0;
  padding: 10px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border-radius: 8px;
  background: var(--surface-quiet);
  font-size: 12px;
}

.checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.checkbox-option {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--surface-quiet);
  color: var(--ink);
  padding: 5px 10px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition:
    border-color 140ms ease,
    background-color 140ms ease,
    color 140ms ease;
}

.checkbox-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.checkbox-option input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.token-result {
  display: grid;
  gap: 5px;
  max-width: 760px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--surface-quiet);
  padding: 12px;
}

.token-result code {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

.secret-note {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

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

.token-input-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.token-input-row input {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.reveal-token {
  flex: none;
  min-width: 64px;
  background: var(--surface-quiet);
}

.remember-field {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  width: fit-content;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.remember-field input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.save-token {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.save-token:hover,
.save-token:focus-visible {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  color: #ffffff;
}

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

.token-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
}

.token-modal[hidden] {
  display: none;
}

.token-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 22, 17, 0.5);
  backdrop-filter: blur(3px);
}

.token-dialog {
  position: relative;
  z-index: 1;
  width: min(460px, 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  padding: 20px;
  animation: dialog-in 200ms ease-out;
}

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

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

.dialog-close {
  min-height: 32px;
}

.token-modal-detail {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.token-status:empty {
  display: none;
}

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

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

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

  .console-sidebar {
    position: static;
    height: auto;
    overflow: visible;
    gap: 16px;
    padding: 18px 20px;
  }

  .brand-block {
    padding: 0;
  }

  h1 {
    max-width: none;
  }

  .console-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .nav-group-label {
    display: none;
  }

  .nav-button {
    flex: 0 0 auto;
    width: auto;
    border-color: var(--rail-line);
  }

  .nav-button[aria-current="page"]::before {
    display: none;
  }

  .sidebar-note {
    display: none;
  }

  .console-workspace {
    padding: 22px 20px 36px;
  }

  .filter-form {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}

@media (max-width: 780px) {
  .console-workspace {
    padding: 18px 12px 30px;
  }

  h2 {
    font-size: 22px;
  }

  .token-form,
  .filter-form,
  .form-grid,
  .form-grid.compact,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .filter-form button {
    width: 100%;
  }

  .panel-toolbar {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
  }

  .panel-status {
    justify-content: space-between;
  }

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

  .state-panel {
    min-height: 200px;
    padding: 24px 16px;
  }

  .console-header {
    margin-bottom: 14px;
  }

  .token-toolbar {
    justify-content: flex-start;
  }
}

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