:root {
  --emerald-700: #047857;
  --emerald-600: #059669;
  --emerald-50: #ecfdf5;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-700: #334155;
  --slate-900: #0f172a;
  --slate-950: #020617;
  --amber-700: #b45309;
  --amber-50: #fffbeb;
  --red-700: #b91c1c;
  --red-50: #fef2f2;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Segoe UI", sans-serif;
  color: var(--slate-900);
  background: var(--slate-50);
}
a { color: inherit; }
.wrap { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.site-header { background: #065f46; color: white; }
.header-row, .footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.header-row { padding: 10px 0; }
.brand { display: flex; align-items: center; text-decoration: none; color: inherit; }
.brand-name { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; color: white; line-height: 1; }
.header-user { display: flex; align-items: center; gap: 12px; margin: 0; }
.who { color: white; font-size: 14px; font-weight: 600; }
.header-logout {
  border: 1px solid rgba(16, 185, 129, 0.45);
  background: rgba(4, 120, 87, 0.55);
  color: white;
  border-radius: 6px;
  padding: 6px 12px;
  font: inherit;
  cursor: pointer;
}
.header-logout:hover { background: #047857; }
main.wrap { flex: 1; padding: 24px 0 48px; }
.site-footer { background: var(--slate-950); color: #cbd5e1; font-size: 13px; }
.footer-row { padding: 18px 0; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs a, .tab-disabled, .ghost, .primary, .send, .text-button {
  border-radius: 999px;
  font: inherit;
}
.tabs a, .tab-disabled {
  padding: 7px 14px;
  text-decoration: none;
  border: 1px solid transparent;
  color: var(--slate-700);
}
.tabs a.active {
  background: var(--emerald-600);
  border-color: var(--emerald-600);
  color: white;
}
.tabs a:hover { background: var(--emerald-50); color: var(--emerald-700); }
.tabs a.active:hover { background: var(--emerald-600); color: white; }
.tab-disabled { color: var(--slate-400); }

.card {
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: 16px;
  padding: 22px;
}
.login-card {
  width: min(420px, 100%);
  margin: 56px auto;
  padding: 32px 32px 28px;
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}
.login-card h1 { font-size: 32px; margin-bottom: 8px; }
.login-card .lead { margin: 0 0 22px; line-height: 1.45; }
.login-card form { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.login-field { width: 100%; display: flex; flex-direction: column; gap: 6px; }
.login-field label { font-size: 14px; font-weight: 600; color: var(--slate-700); }
.login-card input { height: 44px; }
.login-card .primary { margin-top: 4px; padding: 10px 22px; }
h1 { margin: 0 0 6px; font-size: 28px; }
h2 { margin: 0; font-size: 18px; }
.lead, .muted, .hint { color: var(--slate-500); }
.hint { margin: 0 0 16px; }
.card-head, .table-head, .weight, .actions, .origin, .head-status {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}
.table-head { margin-top: 18px; }
.weight {
  margin-top: 16px;
  padding: 18px 20px;
  border-radius: 16px;
  color: white;
  background: linear-gradient(90deg, #047857, #059669 55%, #0369a1);
}
.weight-label { font-size: 14px; color: #d1fae5; }
.weight-value { font-size: 48px; line-height: 1; font-variant-numeric: tabular-nums; }
.weight-value small { font-size: 18px; }
.weight-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }

.pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--slate-100);
  color: var(--slate-700);
  font-size: 13px;
}
.pill.ok { background: var(--emerald-50); color: var(--emerald-700); }
.pill.wait { background: var(--amber-50); color: var(--amber-700); }
.weight .pill { background: rgba(255,255,255,0.16); color: white; }

.banner, .message {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--red-50);
  color: var(--red-700);
}
.banner.lock { background: var(--emerald-50); color: var(--emerald-700); }
.message.success { background: var(--emerald-50); color: var(--emerald-700); }
.message.warning { background: var(--amber-50); color: var(--amber-700); }
.message.error { background: var(--red-50); color: var(--red-700); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--slate-200); text-align: left; white-space: nowrap; }
th { color: var(--slate-500); font-weight: 600; }
.num, .mono { font-variant-numeric: tabular-nums; }
.plate { font-weight: 650; }
.empty { text-align: center; color: var(--slate-500); }
.text-link { color: var(--emerald-700); font-weight: 600; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

.crumbs { display: flex; gap: 8px; color: var(--slate-500); font-size: 13px; margin-bottom: 12px; }
.crumbs a { color: var(--emerald-700); text-decoration: none; }
.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field.changed input { border-color: #f59e0b; background: #fffbeb; }
label { font-size: 13px; color: var(--slate-700); }
input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  background: white;
}
input:focus { outline: 2px solid #a7f3d0; border-color: var(--emerald-600); }
input[readonly] { background: var(--slate-100); color: var(--slate-700); }
.origin { justify-content: flex-start; font-size: 13px; color: var(--slate-500); }
.actions { margin-top: 18px; justify-content: flex-start; flex-wrap: wrap; }
.primary, .ghost, .send, .text-button { cursor: pointer; }
.primary, .send {
  border: 0;
  color: white;
  padding: 10px 16px;
}
.primary { background: var(--emerald-600); }
.primary:hover { background: var(--emerald-700); }
.send { background: #0369a1; }
.ghost, .text-button {
  border: 1px solid var(--slate-200);
  background: white;
  color: var(--slate-700);
  padding: 8px 14px;
  text-decoration: none;
}
.text-button { border: 0; padding: 0; color: var(--emerald-700); background: transparent; }
.ghost:hover { background: var(--emerald-50); color: var(--emerald-700); }

@media (max-width: 800px) {
  .fields, .weight, .card-head, .footer-row { display: block; }
  .weight-value { font-size: 40px; }
  .weight-side, .head-status { align-items: flex-start; margin-top: 10px; }
  .actions { display: flex; }
}
