:root {
  color-scheme: light;
  --ink: #18202b;
  --muted: #667085;
  --line: #d9e2e7;
  --paper: #f6f9f7;
  --white: #ffffff;
  --green: #28735a;
  --green-soft: #dff1e8;
  --blue: #2c5e87;
  --blue-soft: #e5f0f6;
  --amber: #b96b12;
  --amber-soft: #fff1d6;
  --red: #b63737;
  --shadow: 0 20px 70px rgba(30, 45, 60, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 20% 10%, rgba(40, 115, 90, 0.14), transparent 32%),
    linear-gradient(135deg, #f8fbfa 0%, #edf4f7 100%);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 32px 0;
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 22px;
  align-items: stretch;
}

.brand-panel,
.auth-panel,
.app-panel {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
  border-radius: 8px;
}

.brand-panel {
  min-height: 620px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(229, 240, 246, 0.86)),
    repeating-linear-gradient(90deg, transparent 0 32px, rgba(44, 94, 135, 0.05) 32px 33px);
}

.brand-top {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-mark {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--green);
  color: white;
  font-weight: 800;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 3rem;
  line-height: 1;
}

h2 {
  margin-bottom: 0;
  font-size: 2rem;
}

h3 {
  margin-bottom: 10px;
}

.brand-copy {
  max-width: 280px;
  color: #344054;
  font-size: 1.08rem;
  line-height: 1.55;
}

.status-strip {
  display: grid;
  gap: 10px;
}

.status-strip span,
.pill {
  width: fit-content;
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 0.84rem;
  font-weight: 800;
}

.auth-panel,
.app-panel {
  padding: 24px;
}

.auth-panel {
  align-self: center;
  max-width: 520px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 6px;
  margin-bottom: 22px;
  background: #eef4f1;
  border-radius: 8px;
}

.tab {
  border: 0;
  padding: 11px 14px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.tab.active {
  background: var(--white);
  color: var(--ink);
}

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

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

.field span {
  color: #475467;
  font-size: 0.82rem;
  font-weight: 800;
}

.field input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 13px;
  background: #fbfdfc;
  color: var(--ink);
  outline: none;
}

.field input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(40, 115, 90, 0.14);
}

.primary,
.ghost,
.warning {
  min-height: 44px;
  border-radius: 7px;
  border: 1px solid transparent;
  padding: 0 15px;
  font-weight: 850;
}

.primary {
  background: var(--green);
  color: white;
}

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

.warning {
  background: var(--amber-soft);
  color: var(--amber);
}

.wide {
  width: 100%;
}

.hidden {
  display: none !important;
}

.app-panel {
  grid-column: span 1;
}

.app-header,
.detail-top,
.section-head,
.inline-form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.workspace {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 260px;
  gap: 18px;
  margin-top: 24px;
}

.device-list,
.device-detail,
.pairing-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 16px;
}

.device-button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  padding: 12px;
  margin-bottom: 10px;
  text-align: left;
}

.device-button.active {
  border-color: var(--green);
  background: var(--green-soft);
}

.device-button strong,
.device-button span {
  display: block;
}

.device-button span {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 4px;
}

.empty-state {
  display: grid;
  min-height: 360px;
  place-content: center;
  text-align: center;
  color: var(--muted);
}

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

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 20px 0;
}

.metrics div {
  padding: 14px;
  border-radius: 8px;
  background: var(--blue-soft);
}

.metrics span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.metrics strong {
  display: block;
  margin-top: 6px;
  color: var(--blue);
  font-size: 1.1rem;
}

.actions {
  display: grid;
  grid-template-columns: 1.35fr 1fr 0.8fr;
  gap: 10px;
}

.inline-form {
  margin: 20px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.compact {
  flex: 1;
}

.compact-form {
  gap: 12px;
}

.pairing-panel p {
  color: var(--muted);
  line-height: 1.45;
}

.muted {
  color: var(--muted);
  line-height: 1.45;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  padding: 11px 12px;
  border-left: 3px solid var(--green);
  background: #fbfdfc;
  border-radius: 6px;
}

.timeline-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.8rem;
}

.text-button,
.danger-link {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 800;
}

.danger-link {
  margin-top: 18px;
  color: var(--red);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  max-width: min(480px, calc(100% - 32px));
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

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

  .brand-panel {
    min-height: auto;
    gap: 40px;
  }

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

@media (max-width: 620px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding: 10px 0;
  }

  .brand-panel,
  .auth-panel,
  .app-panel {
    padding: 18px;
  }

  h1 {
    font-size: 2.35rem;
  }

  .metrics,
  .actions,
  .inline-form {
    grid-template-columns: 1fr;
    display: grid;
  }

  .app-header,
  .detail-top {
    align-items: flex-start;
    flex-direction: column;
  }
}
