:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --line: #d8dde6;
  --text: #172033;
  --muted: #667085;
  --brand: #1f6f78;
  --brand-dark: #16525a;
  --danger: #b42318;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
  color: var(--text);
  background: var(--bg);
  font-family: Arial, Helvetica, sans-serif;
}
a { color: inherit; }
aside {
  min-height: 100vh;
  background: #15222e;
  color: #e6edf3;
  padding: 18px;
  position: sticky;
  top: 0;
}
.brand {
  font-size: 20px;
  font-weight: 700;
  margin: 8px 0 22px;
}
nav { display: grid; gap: 4px; }
nav a {
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 6px;
  color: #c9d4df;
}
nav a.active, nav a:hover { background: #243645; color: #fff; }
.legal {
  margin-top: 24px;
  font-size: 12px;
  color: #aab7c4;
  line-height: 1.45;
}
.app { padding: 24px; min-width: 0; }
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
h1, h2 { margin: 0; letter-spacing: 0; }
h1 { font-size: 26px; }
h2 { font-size: 18px; margin-bottom: 14px; }
header p, .muted { color: var(--muted); margin: 4px 0 0; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 16px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.metrics article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}
.metrics strong { display: block; font-size: 28px; }
.metrics span { color: var(--muted); font-size: 13px; }
.grid2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .7fr);
  gap: 16px;
  align-items: start;
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
form { margin: 0; }
.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.form-grid > button {
  justify-self: start;
  align-self: end;
  width: auto;
  min-width: 150px;
}
label { display: grid; gap: 6px; font-size: 13px; color: #344054; font-weight: 700; }
input, select, textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid #c8d0dc;
  border-radius: 6px;
  padding: 9px 10px;
  font: inherit;
  color: var(--text);
  background: #fff;
}
textarea { resize: vertical; }
fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}
legend { padding: 0 6px; color: #475467; font-weight: 700; }
.check {
  display: flex;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  margin: 8px 0;
}
.check input { width: auto; min-height: auto; }
.wide { grid-column: 1 / -1; }
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 0;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
button:hover, .button:hover { background: var(--brand-dark); }
button:disabled {
  opacity: .72;
  cursor: wait;
}
.ghost { color: var(--brand); font-weight: 700; text-decoration: none; }
.table-link {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}
.table-link:hover { text-decoration: underline; }
.whats-link {
  color: #0f766e;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.whats-link:hover { text-decoration: underline; }
.danger { background: var(--danger); color: #fff; }
.danger:hover { background: #912018; }
.sm { min-height: 30px; padding: 5px 8px; font-size: 12px; }
.alert {
  padding: 12px 14px;
  border-radius: 8px;
  background: #e6f4f1;
  border: 1px solid #b7ddd7;
  margin-bottom: 16px;
}
.alert.danger { background: #fef3f2; color: var(--danger); border-color: #fecdca; }
.search-loading {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, .42);
}
.search-loading[hidden] { display: none; }
.search-loading-box {
  width: min(420px, 100%);
  padding: 22px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 22px 50px rgba(15, 23, 42, .2);
}
.loading-title {
  font-weight: 800;
  font-size: 18px;
  margin-bottom: 14px;
}
.loading-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6edf3;
}
.loading-bar span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #2f9e8f);
  animation: loading-progress 1.1s ease-in-out infinite;
}
.search-loading-box p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
}
body.is-searching { cursor: wait; }
@keyframes loading-progress {
  0% { transform: translateX(-105%); }
  100% { transform: translateX(245%); }
}
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th, td {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th { color: #475467; font-size: 12px; text-transform: uppercase; }
td form { display: inline; }
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 140px;
}
.row-actions form {
  display: flex;
}
.pill {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf2f7;
  font-size: 12px;
  white-space: nowrap;
}
.score {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: #e6f4f1;
  color: var(--brand-dark);
  display: grid;
  place-items: center;
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 8px;
}
.login {
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  background: #eff3f6;
}
.login-box {
  width: min(430px, calc(100vw - 28px));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
}
.login-box h1 { margin-bottom: 8px; }
.login-box p, .login-box small { color: var(--muted); line-height: 1.45; }
.login-box form { display: grid; gap: 12px; margin: 18px 0; }
@media (max-width: 960px) {
  body { grid-template-columns: 1fr; }
  aside { position: static; min-height: auto; }
  nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid2, .form-grid { grid-template-columns: 1fr; }
  .app { padding: 16px; }
}
@media print {
  aside, header, .toolbar, button, .button { display: none !important; }
  body { display: block; background: #fff; }
  .panel { border: 0; padding: 0; }
}
