:root {
  color-scheme: light;
  --page: #f4f6f8;
  --panel: #ffffff;
  --ink: #18232f;
  --muted: #607080;
  --line: #d9e1e8;
  --accent: #0f7b6c;
  --accent-strong: #085f54;
  --warn: #a15c00;
  --danger: #b42318;
  --soft: #eef6f4;
  --shadow: 0 16px 38px rgba(24, 35, 47, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.app-shell {
  width: min(1240px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.15;
}

h2 {
  font-size: 18px;
  line-height: 1.25;
}

p,
.band-head span,
.metric span {
  color: var(--muted);
}

.topbar-actions,
.table-actions,
.band-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.session-pill {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 9px 14px;
  color: #fff;
  background: var(--accent);
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  background: var(--accent-strong);
}

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

.ghost-btn {
  color: var(--ink);
  background: var(--panel);
  border-color: var(--line);
}

.ghost-btn:hover {
  background: #edf3f2;
}

.login-panel,
.form-band,
.data-band {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-panel {
  width: min(460px, 100%);
  padding: 22px;
}

.login-form,
.data-form {
  display: grid;
  gap: 12px;
}

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

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 11px;
  background: #fff;
  color: var(--ink);
}

.workspace {
  display: grid;
  gap: 16px;
}

.hidden {
  display: none;
}

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

.metric {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.metric strong {
  font-size: 28px;
  line-height: 1;
}

.status-line {
  min-height: 44px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--panel);
  color: var(--muted);
}

.status-line.success {
  color: var(--accent-strong);
  border-color: #b5ded7;
  background: var(--soft);
}

.status-line.error {
  color: var(--danger);
  border-color: #efb8b5;
  background: #fff7f7;
}

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

.form-band,
.data-band {
  padding: 18px;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: #fff;
}

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

th {
  color: var(--muted);
  background: #f8fafb;
  font-weight: 800;
}

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

.empty-row {
  color: var(--muted);
}

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

.setup-group {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.setup-group strong,
.setup-group span {
  display: block;
}

.setup-group span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 920px) {
  .topbar,
  .topbar-actions,
  .band-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .metric-grid,
  .work-grid,
  .setup-list {
    grid-template-columns: 1fr;
  }
}
