/* DocArchive — minimal mobile-first stylesheet (Phase 0 placeholder).
   Expanded as templates land in later phases. */

:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --panel-2: #273449;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #2563eb;
  --accent-2: #38bdf8;
  --ok: #16a34a;
  --warn: #d97706;
  --err: #dc2626;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent-2); }

.container { max-width: 980px; margin: 0 auto; padding: 16px; }

.card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.btn {
  display: inline-block;
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 16px;
  font-weight: 600;
  background: var(--accent);
  color: white;
  text-decoration: none;
  cursor: pointer;
}
.btn:active { transform: translateY(1px); }
.btn.ghost { background: var(--panel-2); color: var(--text); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.muted { color: var(--muted); }

/* ---- Top nav ---- */
.topnav {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  background: var(--panel); padding: 10px 16px;
  position: sticky; top: 0; z-index: 10;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.topnav .brand { font-weight: 700; margin-right: auto; color: var(--text); text-decoration: none; }
.topnav a { color: var(--muted); text-decoration: none; padding: 8px 10px; border-radius: 8px; }
.topnav a:hover, .topnav a.active { background: var(--panel-2); color: var(--text); }

/* ---- Forms ---- */
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 4px; }
input, select, textarea {
  width: 100%; background: var(--bg); color: var(--text);
  border: 1px solid #334155; border-radius: 10px; padding: 11px 12px; font: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---- Badges / status ---- */
.badge {
  display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px;
  border-radius: 999px; background: var(--panel-2); color: var(--muted);
}
.badge.ok { background: rgba(22, 163, 74, 0.18); color: #4ade80; }
.badge.warn { background: rgba(217, 119, 6, 0.18); color: #fbbf24; }
.badge.err { background: rgba(220, 38, 38, 0.18); color: #f87171; }

/* ---- Grid of documents ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.doc-card { background: var(--panel); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--text); }
.doc-card img { width: 100%; height: 150px; object-fit: cover; background: #0008; display: block; }
.doc-card .body { padding: 10px 12px; }
.doc-card .title { font-weight: 600; font-size: 14px; line-height: 1.3; }
.doc-card .meta { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---- Detail / review ---- */
.page-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.page-thumbs img { height: 120px; border-radius: 8px; border: 1px solid #334155; }
.bar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.spacer { flex: 1; }
.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; }
.flash.info { background: rgba(37, 99, 235, 0.15); }
.flash.warn { background: rgba(217, 119, 6, 0.15); }
.spinner { width: 16px; height: 16px; border: 2px solid var(--muted); border-top-color: var(--text); border-radius: 50%; display: inline-block; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
hr.sep { border: none; border-top: 1px solid rgba(255, 255, 255, 0.08); margin: 16px 0; }
dl.pairs { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 8px 0; }
dl.pairs dt { color: var(--muted); font-size: 13px; }
dl.pairs dd { margin: 0; word-break: break-word; }

