:root {
  --brand: #363A69;
  --brand-light: #4a4f86;
  --ink: #1d2030;
  --muted: #6b7080;
  --line: #e3e5ec;
  --bg: #f6f7fa;
  --card: #ffffff;
  --danger: #a62828;
  --ok: #1f6b46;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.shell { max-width: 1100px; margin: 0 auto; padding: 32px 20px 64px; }
.shell.narrow { max-width: 460px; padding-top: 72px; }

.cols { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; } }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px;
  margin-bottom: 20px;
}
.card.issued { border-color: var(--brand); border-width: 2px; }

h1 { font-size: 24px; margin: 0 0 16px; letter-spacing: -0.01em; }
h2 { font-size: 16px; margin: 0 0 14px; letter-spacing: -0.01em; }

.brand {
  font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--brand); font-size: 13px; margin-bottom: 18px;
}
.brand.small { margin: 0; font-size: 12px; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.error {
  background: #fdeceb; border: 1px solid #f3c6c2; color: var(--danger);
  padding: 10px 12px; border-radius: 6px; font-size: 14px;
}

label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 5px; }
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=file], input:not([type]), select {
  width: 100%; padding: 9px 11px; font-size: 15px; font-family: inherit;
  border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink);
}
input:focus, select:focus { outline: 2px solid var(--brand-light); outline-offset: 1px; border-color: var(--brand-light); }

.btn {
  display: inline-block; margin-top: 18px; padding: 10px 18px;
  background: var(--brand); color: #fff; border: 0; border-radius: 6px;
  font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--brand-light); }
.btn.ghost { background: transparent; color: var(--brand); border: 1px solid var(--line); }
.btn.tiny { margin: 0; padding: 5px 10px; font-size: 13px; }

.link {
  background: none; border: 0; padding: 0; font: inherit; font-size: 13px;
  color: var(--brand); cursor: pointer; text-decoration: underline;
}
.link.danger { color: var(--danger); }

.topbar {
  background: var(--brand); color: #fff; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
}
.topbar .brand { color: #fff; }
.topbar nav a { color: #d7d9ec; text-decoration: none; margin-left: 18px; font-size: 14px; }
.topbar nav a:hover { color: #fff; text-decoration: underline; }

.doclist { list-style: none; margin: 18px 0 0; padding: 0; }
.doclist li { margin-bottom: 10px; }
.doclist a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px;
  text-decoration: none; color: var(--ink); background: #fff;
}
.doclist a:hover { border-color: var(--brand); background: #fafbff; }
.doc-title { font-weight: 600; }

.doc-row {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  padding: 12px 0; border-top: 1px solid var(--line);
}
.doc-row:first-of-type { border-top: 0; }
.doc-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.row-between { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }

.inline { display: inline-flex; gap: 6px; align-items: center; }
.inline select { width: auto; max-width: 190px; padding: 5px 8px; font-size: 13px; }

.tag {
  display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; padding: 2px 7px; border-radius: 4px; margin-left: 6px; vertical-align: 2px;
}
.tag.proposal { background: #e8eaf6; color: var(--brand); }
.tag.agreement { background: #e4f0e9; color: var(--ok); }
.tag.danger { background: #fdeceb; color: var(--danger); }

table { width: 100%; border-collapse: collapse; }
table td { padding: 9px 0; border-top: 1px solid var(--line); vertical-align: top; }
table tr:first-child td { border-top: 0; }
table.kv td:first-child { width: 110px; color: var(--muted); font-size: 13px; }

code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: #f0f1f6; padding: 1px 5px; border-radius: 3px; }
code.big { font-size: 18px; letter-spacing: 0.06em; }

.checklist { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; max-height: 260px; overflow: auto; }
.check { display: flex; gap: 9px; align-items: flex-start; font-weight: 400; font-size: 14px; margin: 7px 0; }
.check input { width: auto; margin-top: 3px; }

hr.hair { border: 0; border-top: 1px solid var(--line); margin: 10px 0; }
hr.hair:last-child { display: none; }

.notice {
  background: #eef0f9; border: 1px solid #ccd0e6; color: var(--brand);
  padding: 10px 12px; border-radius: 6px; font-size: 14px;
}
.notice.ok { background: #e6f2eb; border-color: #bcdbc9; color: var(--ok); }
.send-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.send-row .btn.tiny { margin: 0; }
button[disabled] { opacity: .45; cursor: not-allowed; }


/* --- split-screen sign-in ------------------------------------------ */

.split { display: flex; min-height: 100vh; }

.split-brand {
  flex: 0 0 42%;
  background: linear-gradient(160deg, #363A69 0%, #272a4d 100%);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px; position: relative;
}
.split-logo { width: 100%; max-width: 320px; height: auto; display: block; }
.split-foot {
  position: absolute; bottom: 28px; left: 0; right: 0; text-align: center;
  color: rgba(255,255,255,.45); font-size: 12px; letter-spacing: .04em;
}

.split-form { flex: 1; display: flex; align-items: center; padding: 48px 40px; background: #fff; }
.split-inner { width: 100%; max-width: 360px; margin: 0 auto; }
.split-inner h1 { font-size: 28px; margin: 0 0 6px; }
.split-inner .muted { margin: 0 0 24px; }
.split-inner label { margin-top: 18px; }
.btn.wide { width: 100%; margin-top: 24px; padding: 12px 18px; }
.spaced { margin-top: 26px; }

@media (max-width: 760px) {
  .split { flex-direction: column; min-height: 100vh; }
  .split-brand { flex: 0 0 auto; padding: 34px 24px; }
  .split-logo { max-width: 200px; }
  .split-foot { display: none; }
  .split-form { padding: 32px 22px 56px; }
}

/* --- logo in the admin bar ------------------------------------------ */

.topbar-brand { display: inline-flex; align-items: center; }
.topbar-brand img { height: 30px; width: auto; display: block; }
