:root {
  --bg: #f4f7fb;
  --panel: #fff;
  --text: #182230;
  --muted: #667085;
  --line: #e4e7ec;
  --primary: #0b6bcb;
  --primary2: #0e4f9e;
  --ok: #067647;
  --warn: #b54708;
  --bad: #b42318;
  --soft: #eef4ff;
  --shadow: 0 10px 30px rgba(16, 24, 40, .08);
  --radius: 16px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
  background: var(--bg);
  color: var(--text);
}
button, input, select, textarea { font: inherit; }
a { color: var(--primary); text-decoration: none; }

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  background: #0b1f36; color: #fff; padding: 12px 20px; flex-wrap: wrap; gap: 10px;
}
.topbar .brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 16px; }
.topbar .logo { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg,#31b6ff,#0b6bcb); display: grid; place-items: center; font-weight: 900; font-size: 12px; }
.topnav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 14px; }
.topnav a { color: #cbd5e1; }
.topnav a:hover { color: #fff; }
.topnav .who { color: #94a3b8; }

.flash-wrap { max-width: 960px; margin: 14px auto 0; padding: 0 16px; }
.flash { background: #fff7ed; border: 1px solid #f0c36a; color: #b54708; padding: 10px 14px; border-radius: 10px; margin-bottom: 8px; }

.page { max-width: 960px; margin: 0 auto; padding: 20px 16px 60px; }

.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 10px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 22px; }
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn { border: 0; border-radius: 10px; padding: 11px 15px; cursor: pointer; font-weight: 700; font-size: 14px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary2); }
.btn-light { background: #fff; border: 1px solid var(--line); color: var(--text); }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px;
}
.card summary { cursor: pointer; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 10px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; }
.field.full, .full { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

.auth-box { max-width: 380px; margin: 60px auto; text-align: center; }
.auth-box h1 { margin: 0 0 4px; color: var(--primary); }
.auth-box form { text-align: left; margin-top: 16px; display: grid; gap: 12px; }
.muted { color: var(--muted); }

.sync-banner { background: #fff7ed; border: 1px solid #f0c36a; color: #b54708; padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; }

.dossier-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.dossier-card { display: block; }
.dossier-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.dossier-card-head strong { color: var(--text); }

.summary-banner {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  border-radius: var(--radius); padding: 16px 18px; background: linear-gradient(135deg,#0b6bcb,#243b80);
  color: #fff; margin-bottom: 16px;
}
.summary-banner small { color: #dbeafe; }
.progress-pct { font-size: 24px; font-weight: 900; }

.section-title { display: flex; justify-content: space-between; align-items: center; margin: 18px 0 10px; }
.section-title h3 { margin: 0; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; font-weight: 700; font-size: 12px; }
.badge.ok { background: #ecfdf3; color: var(--ok); }
.badge.warn { background: #fff7ed; color: var(--warn); }
.badge.bad { background: #fef3f2; color: var(--bad); }

.doc-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin-bottom: 10px; }
.doc-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.thumb { height: 90px; background: linear-gradient(135deg,#dfe8f4,#b9c7d9); display: grid; place-items: center; }
.thumb .placeholder { font-size: 30px; }
.doc-body { padding: 12px; }
.doc-title { font-weight: 800; font-size: 13px; }
.doc-meta { display: flex; gap: 6px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.doc-actions { display: flex; gap: 6px; margin-top: 10px; }
.capture-button {
  flex: 1; border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 8px;
  cursor: pointer; text-align: center; font-size: 12px; position: relative; overflow: hidden;
}
.capture-button input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

.checklist { display: grid; gap: 8px; }
.check { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.check .icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; flex-shrink: 0; }
.check.ok .icon { background: #dcfae6; color: var(--ok); }
.check.missing .icon { background: #fee4e2; color: var(--bad); }
.check .grow { flex: 1; }
.check strong { display: block; font-size: 14px; }
.check small { color: var(--muted); }

.table-wrap { overflow: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; font-size: 14px; }
.table th { font-size: 11px; text-transform: uppercase; color: var(--muted); }

@media (max-width: 620px) {
  .form-grid, .dossier-grid, .doc-grid { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; align-items: flex-start; }
}
