:root {
  --bg: #f4f6f8;
  --card: #fff;
  --ink: #1a1f24;
  --muted: #5c6b7a;
  --line: #d7dee5;
  --accent: #0b6e4f;
  --accent-dark: #102a23;
  --danger: #9b1c1c;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .65rem 1.25rem;
  background: #0a0a0a;
  color: #fff;
  border-bottom: 1px solid #222;
}
.topbar a, .topbar .linkish {
  color: #d7f5ea;
  text-decoration: none;
  margin-right: .75rem;
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
}
.topbar a:hover, .topbar .linkish:hover { color: #fff; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none !important;
  color: #fff !important;
  margin-right: 0 !important;
}
.brand-text {
  font-weight: 800;
  letter-spacing: .12em;
  font-size: 1.05rem;
}
.brand-logo {
  height: 34px;
  width: auto;
  display: block;
}
.wrap { padding: 1.25rem; max-width: 1200px; margin: 0 auto; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.25rem;
}
.card.narrow { max-width: 420px; margin: 3rem auto; }
.login-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
  padding: .65rem .75rem;
  background: #0a0a0a;
  border-radius: 8px;
  width: fit-content;
}
.login-brand .brand-text { color: #fff; }
.form-card { max-width: 760px; }
.form-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.form-head h1 { margin: .15rem 0 0; font-size: 1.45rem; }
.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .72rem;
  color: var(--muted);
  font-weight: 600;
}
.doc-form .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
}
.field { display: flex; flex-direction: column; gap: .35rem; margin: 0; }
.field span { font-size: .88rem; font-weight: 600; color: #334; }
.field .hint {
  font-style: normal;
  font-weight: 500;
  color: var(--muted);
  margin-left: .35rem;
  font-size: .8rem;
}
.field-span-2 { grid-column: 1 / -1; }
.field input,
.field select,
.field textarea {
  width: 100%;
  margin: 0;
  padding: .65rem .75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font: inherit;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid rgba(11, 110, 79, .25);
  border-color: var(--accent);
}
.form-actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-top: 1.35rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.muted { color: var(--muted); }
.row.between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff !important;
  padding: .55rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  font: inherit;
}
.btn.secondary { background: #345; }
.btn.ghost {
  background: transparent;
  color: var(--ink) !important;
  border: 1px solid var(--line);
}
table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { border-bottom: 1px solid var(--line); padding: .55rem .6rem; text-align: left; font-size: .92rem; }
th { background: #eef3f0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
label { display: block; margin: .6rem 0; }
input, select, textarea, button {
  font: inherit;
  padding: .4rem .5rem;
  margin-top: .25rem;
}
button:not(.linkish):not(.btn) { background: var(--accent); color: #fff; border: 0; border-radius: 6px; cursor: pointer; }
.filters { display: flex; gap: 1rem; flex-wrap: wrap; align-items: end; margin-bottom: 1rem; }
.messages { list-style: none; padding: 0; }
.messages li { padding: .6rem .8rem; margin-bottom: .5rem; border-radius: 6px; background: #e7f6ee; }
.messages .error { background: #fde8e8; color: var(--danger); }
.inline { display: inline; }

@media (max-width: 700px) {
  .doc-form .form-grid { grid-template-columns: 1fr; }
  .field-span-2 { grid-column: auto; }
  .topbar { flex-direction: column; align-items: flex-start; }
  .brand-logo { height: 28px; }
}
