:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --panel: #ffffff;
  --panel-soft: #eef4f2;
  --text: #162127;
  --muted: #637178;
  --line: #d9e1e4;
  --accent: #157b64;
  --accent-dark: #0d5d4c;
  --blue: #2563eb;
  --amber: #b45309;
  --danger: #b42318;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

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

a {
  color: inherit;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 460px) 1fr;
}

.login-panel {
  display: grid;
  align-content: center;
  gap: 26px;
  padding: 44px;
  background: var(--panel);
  border-right: 1px solid var(--line);
}

.login-info {
  display: grid;
  align-content: end;
  min-height: 100vh;
  padding: 48px;
  background:
    linear-gradient(0deg, rgba(22, 33, 39, 0.72), rgba(22, 33, 39, 0.1)),
    url("data:image/svg+xml,%3Csvg width='1200' height='900' viewBox='0 0 1200 900' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='1200' height='900' fill='%23dfe7e5'/%3E%3Cg fill='none' stroke='%238fa7a0' stroke-width='2' opacity='.45'%3E%3Cpath d='M145 705h910M170 640h860M210 580h780M265 705V420h190v285M515 705V350h255v355M835 705V465h155v240'/%3E%3Cpath d='M312 462h82M312 510h82M312 558h82M565 405h150M565 465h150M565 525h150M875 515h75M875 570h75'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  color: #ffffff;
}

.login-info h2 {
  max-width: 760px;
  margin: 10px 0 0;
  font-size: clamp(34px, 6vw, 72px);
  line-height: 0.96;
  letter-spacing: 0;
}

.brand-row {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 14px;
  align-items: center;
}

.brand-row.compact {
  grid-template-columns: 42px 1fr;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
}

.compact .brand-mark {
  width: 42px;
  height: 42px;
}

.brand-row h1,
.brand-row p {
  margin: 0;
}

.brand-row h1 {
  font-size: 22px;
  letter-spacing: 0;
}

.brand-row p,
.eyebrow,
.section-head p,
.profile span,
td span,
.empty-inline {
  color: var(--muted);
}

.login-info .eyebrow {
  color: rgba(255, 255, 255, 0.78);
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  font-weight: 800;
}

.login-actions,
.quick-login {
  display: grid;
  gap: 10px;
}

.quick-login p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 750;
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.button.primary:hover {
  background: var(--accent-dark);
}

.button.ghost {
  background: transparent;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 22px;
  padding: 22px;
  background: var(--panel);
  border-right: 1px solid var(--line);
}

.nav {
  display: grid;
  align-content: start;
  gap: 8px;
}

.nav-button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  padding: 0 12px;
  text-align: left;
  cursor: pointer;
  font-weight: 760;
}

.nav-button span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--accent-dark);
  font-size: 12px;
}

.nav-button.active,
.nav-button:hover {
  border-color: var(--line);
  background: #f7faf9;
}

.profile {
  display: grid;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

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

.topbar,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 22px;
}

.topbar h2,
.section-head h3 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h2 {
  font-size: 30px;
}

.section {
  display: grid;
  gap: 18px;
}

.pill,
.status {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: #edf2f4;
  color: var(--muted);
  font-weight: 760;
  font-size: 13px;
  white-space: nowrap;
}

.status.active {
  background: #e3f5ee;
  color: var(--accent-dark);
}

.status.paused {
  background: #fff4e5;
  color: var(--amber);
}

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

.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
  display: grid;
  gap: 4px;
}

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

.metric strong {
  font-size: 24px;
  letter-spacing: 0;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

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

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

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  background: #f8fafb;
}

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

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

.timeline-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}

.timeline-item p {
  margin: 4px 0 0;
  color: var(--muted);
}

.timeline-item span {
  color: var(--muted);
  white-space: nowrap;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 24px;
  color: var(--muted);
  background: var(--panel);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(22, 33, 39, 0.44);
  z-index: 10;
}

.modal {
  width: min(760px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.modal header,
.modal footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.modal footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  justify-content: flex-end;
}

.modal h3 {
  margin: 0;
}

.modal-body {
  padding: 16px;
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

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

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

.field label {
  font-weight: 760;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  min-height: 42px;
  padding: 9px 11px;
  color: var(--text);
}

.field textarea {
  resize: vertical;
}

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

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  background: var(--text);
  color: #ffffff;
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: 0 18px 42px rgba(22, 33, 39, 0.22);
  z-index: 20;
}

.toast.error {
  background: var(--danger);
}

@media (max-width: 820px) {
  .login-screen,
  .shell {
    grid-template-columns: 1fr;
  }

  .login-panel,
  .login-info {
    min-height: auto;
    padding: 24px;
  }

  .login-info h2 {
    font-size: 38px;
  }

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

  .nav {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
    padding-bottom: 8px;
  }

  .profile {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .profile .button {
    grid-row: span 2;
  }

  .content {
    padding: 18px;
  }

  .topbar,
  .section-head,
  .timeline-item {
    display: grid;
  }

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

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