:root {
  --ink: #2b2620; --paper: #faf6ef; --card: #ffffff; --accent: #7a5c2e;
  --accent-soft: #efe6d6; --ok: #3d7a45; --warn: #b0782a; --err: #a33c3c;
  --line: #e2d9c8;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 15px/1.5 "Segoe UI", system-ui, sans-serif;
}
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 22px; background: var(--card); border-bottom: 2px solid var(--accent-soft);
  flex-wrap: wrap; gap: 8px;
}
header h1 { font-size: 19px; margin: 0; }
.badge {
  font-size: 11px; background: var(--accent); color: #fff; border-radius: 9px;
  padding: 2px 8px; vertical-align: middle; letter-spacing: .5px;
}
nav a {
  color: var(--accent); text-decoration: none; margin-left: 16px; font-weight: 600;
}
nav a:hover { text-decoration: underline; }
main { padding: 22px; max-width: 1250px; margin: 0 auto; }
h2 { margin-top: 4px; }
a { color: var(--accent); }

.cards { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 22px; min-width: 130px; text-align: center;
}
.stat .n { font-size: 28px; font-weight: 700; color: var(--accent); }

table { border-collapse: collapse; width: 100%; background: var(--card); }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); }
th { background: var(--accent-soft); }
tr:hover td { background: #fdfaf4; }

.status { font-size: 12px; padding: 2px 8px; border-radius: 8px; color: #fff; }
.status.indexed { background: var(--ok); }
.status.error { background: var(--err); }
.status.uploaded, .status.classified { background: var(--warn); }

.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px 18px; margin-bottom: 16px;
}
.viewer { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.scan { position: relative; flex: 1 1 460px; border: 1px solid var(--line); }
.scan img { width: 100%; display: block; }
.hl {
  position: absolute; border: 2px solid transparent; border-radius: 2px;
  pointer-events: none; transition: all .15s;
}
.hl.active { border-color: #d9534f; background: rgba(217,83,79,.18); }
.side { flex: 1 1 380px; max-height: 82vh; overflow-y: auto; }

.claim {
  border-left: 4px solid var(--accent); background: var(--accent-soft);
  border-radius: 6px; padding: 8px 12px; margin-bottom: 8px; cursor: pointer;
}
.claim:hover { filter: brightness(.97); }
.claim .ct { font-weight: 700; font-size: 13px; text-transform: uppercase;
  letter-spacing: .4px; color: var(--accent); }
.claim .conf { float: right; font-size: 12px; color: #7c6f5b; }
.ocrline { padding: 3px 6px; border-radius: 4px; cursor: pointer; font-size: 13.5px; }
.ocrline:hover, .ocrline.active { background: #ffe9b8; }

.drop {
  border: 2px dashed var(--accent); border-radius: 12px; padding: 46px;
  text-align: center; background: var(--card); cursor: pointer; margin-bottom: 14px;
}
.drop.hover { background: var(--accent-soft); }
button, .btn {
  background: var(--accent); border: 0; color: #fff; border-radius: 8px;
  padding: 9px 18px; font-weight: 600; cursor: pointer; font-size: 14px;
}
input[type=text], input[type=search] {
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px;
  width: 100%; max-width: 460px; font-size: 15px; background: var(--card);
}
.muted { color: #857763; font-size: 13px; }
.toggle { margin-left: 10px; }
.tbtn {
  background: var(--card); color: var(--accent); border: 1px solid var(--accent);
  padding: 3px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.tbtn:first-child { border-radius: 8px 0 0 8px; }
.tbtn:last-child { border-radius: 0 8px 8px 0; border-left: 0; }
.tbtn.active { background: var(--accent); color: #fff; }
/* standalone tab rows (People branches) — spaced pills, not a joined pair */
p.toggle .tbtn { border-radius: 8px; margin: 0 6px 6px 0; border-left: 1px solid var(--accent); }
.pill { background: var(--accent-soft); border-radius: 8px; padding: 2px 9px;
  font-size: 12px; margin-right: 6px; display: inline-block; }
.loglist li { margin-bottom: 3px; font-size: 13.5px; }
.notice { background: #fff8e6; border: 1px solid #ecd9a0; border-radius: 8px;
  padding: 10px 14px; margin-bottom: 14px; }

/* ---- login screen (platform only) ---- */
.login-wrap {
  max-width: 420px; margin: 12vh auto; text-align: center;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 40px 34px;
}
.login-wrap h1 { font-size: 26px; }
.login-wrap input { max-width: 100%; margin-bottom: 12px; }
.login-note { margin-top: 14px; }

/* the hidden attribute must beat display:flex */
header[hidden] { display: none; }
