:root {
  color-scheme: dark;
  --bg: #0f1419;
  --bg-elevated: #151c24;
  --panel: #171f28;
  --panel-soft: #1d2732;
  --panel-strong: #111820;
  --border: #263241;
  --border-soft: #202b38;
  --text: #edf2f7;
  --muted: #98a5b3;
  --muted-strong: #b7c1cd;
  --accent: #37b27f;
  --accent-strong: #1e8d61;
  --accent-soft: rgba(55, 178, 127, 0.14);
  --accent-outline: rgba(55, 178, 127, 0.35);
  --danger: #dd6a63;
  --warning: #d2a24b;
  --shadow: 0 16px 44px rgba(0, 0, 0, 0.22);
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.14);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(55, 178, 127, 0.08), transparent 24%),
    linear-gradient(180deg, #0d1217 0%, #11171e 100%);
  color: var(--text);
}

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

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0f151c;
  color: var(--text);
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

input::placeholder,
textarea::placeholder {
  color: #6f7d8c;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-outline);
  box-shadow: 0 0 0 3px rgba(55, 178, 127, 0.08);
  background: #121a22;
}

textarea {
  resize: vertical;
}

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

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100vh;
  border-right: 1px solid var(--border-soft);
  background: rgba(11, 16, 21, 0.95);
  backdrop-filter: blur(18px);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 6px 14px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(55, 178, 127, 0.22), rgba(55, 178, 127, 0.1));
  border: 1px solid var(--accent-outline);
  color: #d9ffef;
  font-size: 18px;
  font-weight: 700;
}

.brand-title {
  font-size: 17px;
  font-weight: 700;
}

.brand-subtitle,
.panel-subtitle,
.muted,
.topbar p,
.summary-item span,
.metric-label,
.license-overview-label,
.license-overview-meta,
.field span,
.empty-cell,
.empty-state,
.hint-box,
th {
  color: var(--muted);
}

.panel {
  background: linear-gradient(180deg, rgba(25, 34, 43, 0.96), rgba(20, 28, 36, 0.98));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.sidebar .panel,
.main .panel {
  padding: 16px;
}

.panel-title,
.subsection-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: 0;
}

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

.panel-subtitle {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
}

.subsection-title {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.field span {
  font-size: 12px;
}

.checkbox-field {
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
}

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

.checkbox-field span {
  color: var(--text);
  font-size: 13px;
}

.nav-list,
.button-row,
.toolbar,
.download-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-list {
  flex-direction: column;
}

.button,
.link-button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #1f2a36;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.button:hover,
.link-button:hover {
  border-color: #36465a;
  background: #253140;
}

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

.button.primary {
  background: linear-gradient(180deg, #45c18c, #2da572);
  border-color: #3bbb87;
  color: #07130d;
  font-weight: 700;
}

.button.primary:hover {
  background: linear-gradient(180deg, #4eca94, #31ae79);
}

.button.ghost,
.nav-button {
  width: 100%;
  justify-content: flex-start;
}

.nav-button {
  background: transparent;
  border-color: transparent;
  padding-left: 12px;
  color: var(--muted-strong);
}

.nav-button:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: transparent;
}

.nav-button-active {
  background: linear-gradient(180deg, rgba(55, 178, 127, 0.18), rgba(55, 178, 127, 0.1));
  border-color: var(--accent-outline);
  color: #e4fff2;
}

.button:disabled,
.link-button.disabled {
  opacity: 0.42;
  pointer-events: none;
}

.status-line,
.refresh-chip {
  min-height: 24px;
  display: flex;
  align-items: center;
  font-size: 12px;
}

.status-line {
  padding-top: 2px;
}

.hint-box {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: rgba(11, 16, 22, 0.62);
  font-size: 12px;
  line-height: 1.45;
}

.main {
  padding: 26px 28px 32px;
  display: grid;
  gap: 18px;
  align-content: start;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 2px 2px 6px;
}

.topbar h1 {
  margin: 0 0 6px;
  font-size: 30px;
  font-weight: 700;
}

.topbar p {
  margin: 0;
  max-width: 760px;
  line-height: 1.45;
}

.refresh-chip {
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(16, 23, 31, 0.9);
}

.view-stack {
  display: none;
  gap: 18px;
  align-content: start;
}

.view-active {
  display: grid;
}

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

.metric {
  padding: 16px 18px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: linear-gradient(180deg, rgba(27, 36, 47, 0.98), rgba(21, 29, 38, 0.98));
  box-shadow: var(--shadow-soft);
  min-height: 112px;
}

.metric-label {
  font-size: 12px;
  margin-bottom: 10px;
}

.metric-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.06;
  word-break: break-word;
}

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

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

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

.operations-layout {
  display: grid;
  grid-template-columns: minmax(380px, 1.05fr) minmax(480px, 1.35fr);
  gap: 18px;
  align-items: start;
}

.settings-panel,
.license-overview-panel,
.large-panel,
.console-panel,
.notes-panel {
  padding: 18px;
}

.license-overview-panel {
  background: linear-gradient(180deg, rgba(23, 32, 42, 0.98), rgba(18, 25, 33, 1));
}

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

.license-overview-card {
  padding: 16px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: rgba(12, 17, 23, 0.72);
  min-height: 118px;
}

.license-overview-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
}

.license-usage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.progress-track {
  margin-top: 12px;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2ea875, #57d89c);
  transition: width 180ms ease;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: rgba(11, 16, 22, 0.64);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

th,
td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}

td {
  color: #dce4ec;
}

th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: rgba(255, 255, 255, 0.02);
}

tr:hover td {
  background: rgba(255, 255, 255, 0.025);
}

.toolbar {
  align-items: center;
}

.toolbar-input {
  flex: 1 1 220px;
}

.transaction-summary {
  margin: 14px 0;
  padding: 16px;
  min-height: 82px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: linear-gradient(180deg, rgba(12, 17, 23, 0.86), rgba(14, 20, 27, 0.92));
}

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

.summary-item {
  display: grid;
  gap: 4px;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.action-grid.single-column {
  grid-template-columns: 1fr;
}

.action-card {
  padding: 14px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: linear-gradient(180deg, rgba(14, 20, 27, 0.94), rgba(12, 17, 23, 0.9));
}

.action-card .panel-title {
  margin-bottom: 6px;
}

.action-card .panel-subtitle {
  margin-top: 0;
  margin-bottom: 12px;
}

.timeline-wrap table {
  min-width: 780px;
}

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

.compact-form-grid .field {
  margin-bottom: 0;
}

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

.download-row {
  margin-bottom: 12px;
}

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

.link-button {
  background: #18212b;
}

.readonly-output {
  min-height: 72px;
  font-family: "Cascadia Mono", "Consolas", monospace;
}

.applications-table {
  min-width: 980px;
}

.applications-table tr.is-selected td {
  background: rgba(55, 178, 127, 0.08);
}

.applications-table tr.is-current td {
  box-shadow: inset 3px 0 0 rgba(55, 178, 127, 0.58);
}

.button.inline-button {
  min-height: 32px;
  padding: 0 10px;
}

.readiness-grid {
  margin-bottom: 14px;
}

.code-preview {
  margin: 8px 0 0;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: rgba(11, 16, 22, 0.72);
  color: #dce4ec;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 12px;
  line-height: 1.5;
}

.checklist-grid {
  display: grid;
  gap: 10px;
}

.check-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: rgba(12, 17, 23, 0.72);
}

.notes-panel {
  align-self: start;
  background: rgba(17, 23, 31, 0.86);
  display: none;
}

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

.note-item {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: rgba(11, 16, 22, 0.58);
  color: var(--muted);
  line-height: 1.45;
}

.sidebar-help {
  display: none;
}

.state-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.state-pill.ok {
  background: rgba(55, 178, 127, 0.16);
  color: #92ecc1;
}

.state-pill.warn {
  background: rgba(210, 162, 75, 0.16);
  color: #e4c16c;
}

.state-pill.bad {
  background: rgba(221, 106, 99, 0.16);
  color: #f0a09a;
}

@media (max-width: 1440px) {
  .grid.metrics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 1200px) {
  .content-grid,
  .bottom-grid,
  .license-overview-grid,
  .form-grid,
  .action-grid,
  .operations-layout {
    grid-template-columns: 1fr;
  }

  .shell {
    grid-template-columns: 236px minmax(0, 1fr);
  }
}

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

  .sidebar {
    position: static;
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border-soft);
  }

  .main {
    padding: 16px;
  }

  .topbar {
    flex-direction: column;
  }

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

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