/* Secure Transfer. No external fonts or assets: everything ships inside the application. */

:root {
  --navy: #1f3a5f;
  --navy-deep: #152a45;
  --ink: #1b2430;
  --quiet: #5b6676;
  --mist: #f2f5f8;
  --surface: #ffffff;
  --line: #d5dae1;
  --signal: #2f6fb7;
  --good: #1e7a46;
  --good-tint: #e4f3ea;
  --warn: #9a5b00;
  --warn-tint: #fdf0d9;
  --bad: #b3261e;
  --bad-tint: #fbe6e4;
  --wait-tint: #e8f1fb;
  --serif: Charter, "Iowan Old Style", Cambria, Georgia, serif;
  --sans: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { font-size: 16px; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--mist);
  line-height: 1.45;
}

h1 {
  font-family: var(--serif);
  font-size: 1.9rem;
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.35rem;
  color: var(--navy-deep);
}

h2 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

p { margin: 0 0 1rem; }

a { color: var(--signal); }

.lede { color: var(--quiet); max-width: 62ch; margin-bottom: 1.5rem; }

:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }

/* ---------- top bar */

.topbar {
  background: var(--navy);
  color: #fff;
}

.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.75rem;
  min-height: 60px;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.nav { display: flex; gap: 0.25rem; flex: 1; flex-wrap: wrap; }

.nav a {
  color: #dbe5f1;
  text-decoration: none;
  padding: 0.45rem 0.8rem;
  border-radius: 6px;
  font-size: 0.95rem;
}

.nav a:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

.nav a[aria-current="page"] { background: #fff; color: var(--navy-deep); font-weight: 600; }

.who { text-align: right; font-size: 0.82rem; line-height: 1.25; color: #dbe5f1; }

.who strong { display: block; color: #fff; font-size: 0.9rem; }

.topbar .btn { background: transparent; border-color: rgba(255, 255, 255, 0.45); color: #fff; }

.topbar .btn:hover { background: rgba(255, 255, 255, 0.12); }

.topbar :focus-visible { outline-color: #fff; }

/* ---------- page */

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.page-head .lede { margin-bottom: 0; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

/* ---------- buttons and forms */

.btn {
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.55rem 1.05rem;
  border-radius: 7px;
  border: 1px solid var(--navy);
  background: var(--navy);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.btn:hover { background: var(--navy-deep); }

.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.btn.plain { background: var(--surface); color: var(--navy-deep); border-color: var(--line); }

.btn.plain:hover { background: var(--mist); }

.btn.small { padding: 0.35rem 0.75rem; font-size: 0.88rem; }

.btn.danger { background: var(--surface); color: var(--bad); border-color: var(--line); }

.btn.danger:hover { background: var(--bad-tint); }

label { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 0.3rem; }

.hint { font-weight: 400; color: var(--quiet); font-size: 0.85rem; }

input[type="text"], input[type="email"], input[type="password"], select, textarea {
  font: inherit;
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid #b9c1cc;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}

textarea { min-height: 4.5rem; resize: vertical; }

.field { margin-bottom: 1rem; }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; }

.actions { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }

.message {
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  border: 1px solid transparent;
}

.message.error { background: var(--bad-tint); color: #7d1a14; border-color: #efc4c0; }

.message.ok { background: var(--good-tint); color: #14532f; border-color: #bfe0cb; }

/* ---------- sign in */

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

.signin-brand {
  background: var(--navy);
  color: #fff;
  padding: 12vh 8vw 3rem;
}

.signin-brand h1 { color: #fff; font-size: 2.6rem; margin-bottom: 1rem; }

.signin-brand p { color: #dbe5f1; max-width: 34ch; font-size: 1.05rem; }

.signin-brand ul { list-style: none; padding: 0; margin: 2.5rem 0 0; color: #dbe5f1; }

.signin-brand li { padding: 0.55rem 0; border-top: 1px solid rgba(255, 255, 255, 0.18); max-width: 34ch; }

.signin-form { padding: 12vh 8vw 3rem; background: var(--surface); }

.signin-form form { max-width: 360px; }

.signin-form h2 { font-family: var(--serif); font-size: 1.5rem; color: var(--navy-deep); margin-bottom: 1.25rem; }

/* ---------- tabs */

.tabs-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem 1rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}

.tabs-bar .btn { margin-bottom: 0.35rem; }

.tabs { display: flex; gap: 0.25rem; margin-bottom: 0; }

.pick { display: flex; gap: 0.7rem; align-items: flex-start; }

.pick input[type="checkbox"], .no-tick { width: 1.05rem; height: 1.05rem; margin: 0.2rem 0 0; flex: none; accent-color: var(--navy); }

.tabs button {
  font: inherit;
  font-weight: 600;
  color: var(--quiet);
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 0.6rem 0.9rem;
  cursor: pointer;
}

.tabs button[aria-selected="true"] { color: var(--navy-deep); border-bottom-color: var(--navy); }

.count {
  font-weight: 600;
  font-size: 0.8rem;
  background: var(--mist);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 0.45rem;
  margin-left: 0.35rem;
}

/* ---------- ledger tables */

.ledger-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 10px 10px;
  overflow-x: auto;
}

.ledger-wrap.standalone { border-top: 1px solid var(--line); border-radius: 10px; }

table.ledger { width: 100%; border-collapse: collapse; font-size: 0.95rem; }

.ledger th {
  text-align: left;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--quiet);
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.ledger td { padding: 0.85rem 1rem; border-bottom: 1px solid #e7eaef; vertical-align: middle; }

.ledger tr:last-child td { border-bottom: 0; }

.ledger .num { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--quiet); }

.ledger .right { text-align: right; white-space: nowrap; }

.file-name { font-weight: 600; overflow-wrap: anywhere; }

.ledger .org { white-space: nowrap; }

.sub { display: block; color: var(--quiet); font-size: 0.85rem; overflow-wrap: anywhere; }

.empty { padding: 2.5rem 1.5rem; text-align: left; color: var(--quiet); }

.empty strong { display: block; color: var(--ink); font-size: 1.05rem; margin-bottom: 0.25rem; }

/* ---------- status seal */

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem 0.25rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
  background: var(--mist);
  color: var(--quiet);
}

.status::before {
  content: "";
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.status[data-s="CLEAN"] { background: var(--good-tint); color: var(--good); }

.status[data-s="UNSCANNED"] { background: var(--warn-tint); color: var(--warn); }

.status[data-s="SCANNING"] { background: var(--wait-tint); color: var(--signal); }

.status[data-s="INFECTED"], .status[data-s="REJECTED"], .status[data-s="FAILED"] { background: var(--bad-tint); color: var(--bad); }

/* ---------- send a file */

.dropzone {
  border: 2px dashed #8fa3bd;
  border-radius: 12px;
  background: #f8fafc;
  padding: 2.75rem 1.5rem;
  text-align: center;
  margin-bottom: 1rem;
}

.dropzone.over { border-color: var(--navy); background: var(--wait-tint); }

.dropzone strong { display: block; font-family: var(--serif); font-size: 1.35rem; color: var(--navy-deep); margin-bottom: 0.3rem; }

.dropzone span { color: var(--quiet); display: block; margin-bottom: 1rem; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.queue { list-style: none; margin: 0 0 1rem; padding: 0; }

.queue li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.25rem 1rem;
  align-items: center;
  padding: 0.75rem 0;
  border-top: 1px solid #e7eaef;
}

.queue li:first-child { border-top: 0; }

.queue progress { grid-column: 1 / -1; width: 100%; height: 0.55rem; accent-color: var(--navy); }

.queue .state { font-size: 0.88rem; color: var(--quiet); text-align: right; }

.queue .state.done { color: var(--good); font-weight: 600; }

.queue .state.failed { color: var(--bad); font-weight: 600; }

/* ---------- dialog */

dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 460px;
  width: calc(100% - 2rem);
  color: var(--ink);
}

dialog::backdrop { background: rgba(21, 42, 69, 0.5); }

dialog h2 { font-family: var(--serif); font-size: 1.3rem; color: var(--navy-deep); }

dialog .actions { justify-content: flex-end; margin-top: 1.25rem; }

/* ---------- integrations */

h2.section { margin: 2rem 0 0.75rem; font-family: var(--serif); font-size: 1.3rem; color: var(--navy-deep); }

.ledger-wrap.standalone + .panel { margin-top: 1rem; }

.secret {
  font-family: Consolas, "SF Mono", Menlo, monospace;
  font-size: 0.9rem;
  background: #fff;
  border: 1px solid #bfe0cb;
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  margin: 0.5rem 0 0.6rem;
  overflow-wrap: anywhere;
  user-select: all;
}

.field.narrow { max-width: 360px; }

.ledger.facts th { width: 11rem; border-bottom: 1px solid #e7eaef; color: var(--quiet); font-size: 0.9rem; padding: 0.85rem 1rem; }

.ledger.facts tr:last-child th { border-bottom: 0; }

/* ---------- small screens */

@media (max-width: 760px) {
  .signin { grid-template-columns: 1fr; }
  .signin-brand, .signin-form { padding: 2.5rem 1.5rem; }
  .signin-brand ul { display: none; }
  .who { display: none; }
  main { padding-top: 1.25rem; }

  .topbar-inner { gap: 0.4rem 1rem; padding-top: 0.6rem; padding-bottom: 0.6rem; }
  .brand { flex: 1; }
  .nav { order: 3; flex-basis: 100%; }

  /* Each table row becomes a small block: name on top, details and actions underneath. */
  .ledger thead { display: none; }
  table.ledger, .ledger tbody { display: block; }
  .ledger tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem 1rem;
    align-items: center;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #e7eaef;
  }
  .ledger tr:last-child { border-bottom: 0; }
  .ledger td { padding: 0; border: 0; }
  .ledger td:first-child { grid-column: 1 / -1; }
  .ledger .hide-small { display: none; }
  .ledger .org { white-space: normal; }
}
