:root {
  --ink: #101827;
  --muted: #667085;
  --line: rgba(16, 24, 39, 0.1);
  --surface: #ffffff;
  --bg: #f4f6f8;
  --accent: #0b7a75;
  --danger: #b42318;
  --warning: #b7791f;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
}

button,
input,
select {
  font: inherit;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  padding: 18px;
  background: #0f172a;
  color: #e5e7eb;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.brand strong {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: #0f172a;
  background: #5eead4;
}

.brand span {
  font-size: 18px;
  font-weight: 900;
}

.nav {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  margin-bottom: 6px;
  padding: 0 12px;
  color: #cbd5e1;
  background: transparent;
  text-align: left;
  font-weight: 800;
  cursor: pointer;
}

.nav.active,
.nav:hover {
  color: #0f172a;
  background: #ffffff;
}

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

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

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 30px;
}

h2 {
  font-size: 18px;
}

.view {
  display: none;
}

.view.visible {
  display: grid;
  gap: 18px;
}

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

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

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  background: var(--surface);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.06);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

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

.metric {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: #ffffff;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  font-variant-numeric: tabular-nums;
}

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

.stack-row {
  display: grid;
  grid-template-columns: 120px 130px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

progress {
  width: 100%;
  height: 9px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #e2e8f0;
}

progress::-webkit-progress-value {
  border-radius: 999px;
  background: var(--accent);
}

.table-wrap {
  overflow: auto;
}

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

th {
  color: var(--muted);
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 8px;
  color: #0f5132;
  background: #dcfce7;
  font-size: 11px;
  font-weight: 900;
}

.badge.warning {
  color: #7c2d12;
  background: #ffedd5;
}

.badge.danger {
  color: #842029;
  background: #fee2e2;
}

.primary,
.ghost {
  min-height: 38px;
  border-radius: 11px;
  padding: 0 14px;
  font-weight: 850;
  cursor: pointer;
}

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

.ghost {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #ffffff;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.row-actions button {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.modal {
  width: min(720px, calc(100vw - 32px));
  border: 0;
  border-radius: 18px;
  padding: 0;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.25);
}

.modal::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.modal form {
  padding: 18px;
}

.modal-head,
.modal-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.modal-actions {
  justify-content: flex-end;
  margin-top: 16px;
}

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

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

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

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 8px;
  z-index: 20;
}

.toast {
  max-width: 360px;
  border-radius: 12px;
  padding: 12px 14px;
  color: #ffffff;
  background: #0f172a;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.22);
  font-size: 13px;
  font-weight: 800;
}

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

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

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