:root {
  color-scheme: light;
  --bg: #f6f7f8;
  --panel: #ffffff;
  --text: #1d252c;
  --muted: #68737d;
  --line: #dfe4e8;
  --accent: #167a6b;
  --accent-soft: #dff3ef;
  --sidebar: #24313a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.is-hidden {
  display: none !important;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-panel {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
}

.auth-panel .brand {
  color: var(--text);
  margin-bottom: 26px;
}

.auth-heading {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
}

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

.sidebar {
  background: var(--sidebar);
  color: #fff;
  padding: 22px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  margin-bottom: 28px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--accent);
}

.nav {
  display: grid;
  gap: 4px;
}

.nav a {
  color: #d7dee3;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
}

.nav a.active,
.nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.main {
  padding: 28px;
  min-width: 0;
}

.topbar,
.panel-header,
.topbar-actions,
.metrics,
.workspace,
.report-grid,
.form-grid {
  display: grid;
  gap: 16px;
}

.topbar {
  grid-template-columns: 1fr auto;
  align-items: end;
  margin-bottom: 22px;
}

.topbar-actions {
  grid-template-columns: 180px auto auto auto;
  align-items: center;
}

.button-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.status-line {
  min-height: 20px;
  font-size: 13px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.2;
}

h2 {
  font-size: 16px;
}

p,
small {
  color: var(--muted);
}

button,
select,
input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

button {
  padding: 0 14px;
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  cursor: pointer;
}

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

.small-button {
  min-height: 30px;
  padding: 0 9px;
  font-size: 12px;
}

.secondary-button {
  background: #fff;
  color: var(--text);
  border-color: var(--line);
}

.danger-button {
  background: #a23a32;
  border-color: #a23a32;
}

select,
input {
  padding: 0 10px;
}

.compact-input {
  width: 92px;
}

.metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 18px;
}

.metrics article,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metrics article {
  padding: 16px;
  display: grid;
  gap: 6px;
}

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

.metrics strong {
  font-size: 22px;
}

.workspace {
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
  margin-bottom: 18px;
}

.install-guide {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

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

.panel {
  padding: 18px;
  min-width: 0;
}

.panel-header {
  grid-template-columns: 1fr auto;
  align-items: start;
  margin-bottom: 14px;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #101820;
  color: #edf6f4;
  border-radius: 6px;
  padding: 14px;
  margin: 0 0 16px;
  font-size: 13px;
}

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

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 11px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
}

td strong,
td small {
  display: block;
}

td small {
  margin-top: 4px;
}

.journey-preview {
  display: grid;
  gap: 3px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.journey-preview strong {
  color: var(--text);
  font-size: 12px;
}

.journey-preview span {
  display: block;
}

.bar-row {
  display: grid;
  grid-template-columns: 150px 1fr 44px;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  font-size: 14px;
}

.bar-row div {
  height: 9px;
  background: #eef2f3;
  border-radius: 999px;
  overflow: hidden;
}

.bar-row i {
  display: block;
  height: 100%;
  background: var(--accent);
}

.bar-row b {
  text-align: right;
}

@media (max-width: 900px) {
  .app-shell,
  .topbar,
  .workspace,
  .report-grid,
  .metrics {
    grid-template-columns: 1fr;
  }

  .sidebar {
    padding: 14px;
  }

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

  .main {
    padding: 18px;
  }

  .topbar-actions {
    grid-template-columns: 1fr;
  }
}
