:root {
  color-scheme: light;
  --bg: #f8fafc;
  --panel: #ffffff;
  --ink: #111827;
  --muted: #64748b;
  --line: #dbe3ea;
  --brand: #0f766e;
  --brand-strong: #115e59;
  --brand-soft: #ccfbf1;
  --danger: #b91c1c;
  --shadow: 0 14px 40px rgba(15, 23, 42, .08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

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

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

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: #0b1220;
  color: #eef7f5;
}

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

.brand strong,
.brand span {
  display: block;
}

.brand span {
  color: #a7b3c5;
  font-size: 13px;
}

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

.nav-item {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  color: #cbd5e1;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.nav-item.active,
.nav-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, .09);
}

.install-card {
  margin-top: auto;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  color: #cbd5e1;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--danger);
}

.status-dot.online {
  background: #22c55e;
}

.workspace {
  min-width: 0;
  padding: 26px;
}

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

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

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

h2 {
  font-size: 18px;
}

h3 {
  margin-bottom: 8px;
  font-size: 15px;
}

.topbar p,
.help,
.summary-grid p {
  color: var(--muted);
  line-height: 1.5;
}

.actions,
.panel-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.primary-button,
.secondary-button,
.icon-button {
  min-height: 40px;
  border-radius: 8px;
  cursor: pointer;
}

.primary-button {
  border: 0;
  padding: 0 14px;
  color: #ffffff;
  background: var(--brand);
}

.primary-button:hover {
  background: var(--brand-strong);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: wait;
  opacity: .65;
}

.secondary-button {
  border: 1px solid var(--line);
  padding: 0 14px;
  color: var(--ink);
  background: #ffffff;
}

.icon-button {
  width: 40px;
  border: 1px solid rgba(255, 255, 255, .18);
  color: #ffffff;
  background: rgba(255, 255, 255, .08);
}

.notice {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fffbeb;
  color: #854d0e;
}

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

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

.metric {
  min-height: 98px;
  padding: 16px;
}

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

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}

.panel {
  padding: 18px;
}

.panel-heading {
  justify-content: space-between;
  margin-bottom: 16px;
}

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

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

.summary-grid > div,
.plan-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdff;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 700;
}

.field {
  display: grid;
  gap: 8px;
}

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

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #ffffff;
}

input {
  min-height: 44px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  padding: 12px;
}

select {
  max-width: 220px;
  min-height: 38px;
  padding: 0 10px;
}

.hidden {
  display: none !important;
}

.session-card {
  display: grid;
  gap: 6px;
  max-width: 520px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

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

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 22px;
  background: linear-gradient(135deg, #0b1220 0%, #12343b 48%, #0f766e 100%);
}

.login-panel {
  width: min(100%, 430px);
  display: grid;
  gap: 18px;
  padding: 26px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(2, 6, 23, .28);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-brand strong,
.login-brand span {
  display: block;
}

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

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

.login-message {
  min-height: 22px;
  color: var(--brand-strong);
  font-size: 13px;
  line-height: 1.45;
}

.login-message.error {
  color: var(--danger);
}

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

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

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

  .workspace {
    padding: 18px;
  }

  .topbar,
  .actions,
  .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

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

  .login-panel {
    padding: 22px;
  }
}
