:root {
  color-scheme: light;
  --page: #f4f6f1;
  --panel: #ffffff;
  --ink: #101817;
  --muted: #56635f;
  --line: #dce3db;
  --line-strong: #a7b4ad;
  --green: #0f665a;
  --green-dark: #0a3f39;
  --gold: #b38b45;
  --red: #a13d3e;
  --orange: #9a671f;
  --ok-bg: #e5f5ec;
  --warn-bg: #fff4db;
  --bad-bg: #ffece7;
  --sidebar: #101917;
  --sidebar-panel: #182723;
  --sidebar-line: #30443f;
  --sidebar-ink: #f8faf7;
  --sidebar-muted: #c8d2cc;
}

* { box-sizing: border-box; letter-spacing: 0; }
body {
  margin: 0;
  background: linear-gradient(180deg, #fbfcfa 0, var(--page) 100%);
  color: var(--ink);
  font-family: Inter, Segoe UI, Arial, sans-serif;
}
button, input, select { font: inherit; }

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 18px 16px 22px;
  background: linear-gradient(180deg, rgba(15, 102, 90, .20), rgba(179, 139, 69, .08) 52%, transparent 78%), var(--sidebar);
  color: var(--sidebar-ink);
  border-right: 1px solid #172320;
  box-shadow: 14px 0 34px rgba(15, 23, 22, .22);
}

.brand { display: flex; align-items: center; gap: 13px; margin-bottom: 18px; }
.brand strong { display: block; font-size: 17px; }
.brand span { display: block; color: var(--sidebar-muted); font-size: 12px; margin-top: 3px; }
.mark {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #fffaf0;
  background: linear-gradient(145deg, #0d4f47, #2c665e 58%, #c49a4e);
  box-shadow: 0 14px 28px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .24);
}

.side-section, .side-note {
  border: 1px solid var(--sidebar-line);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  background: linear-gradient(180deg, #1b2e2a, var(--sidebar-panel));
  padding: 13px;
  margin: 12px 0;
}
.side-section h2 { margin: 0 0 10px; font-size: 16px; }
label { display: block; margin: 12px 0 7px; font-weight: 760; }
input, select {
  width: 100%;
  border: 1px solid #d7cbb7;
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff8ec;
  color: #111a17;
  outline: none;
}
input:focus, select:focus { box-shadow: 0 0 0 3px rgba(179, 139, 69, .20); }

.dropzone {
  min-height: 128px;
  display: grid;
  place-items: center;
  text-align: center;
  border: 1px solid var(--sidebar-line);
  border-radius: 8px;
  padding: 12px;
  background: #14221f;
}
.dropzone.is-dragging { border-color: var(--gold); background: #21342f; }
.dropzone strong { display: block; font-size: 14px; }
.dropzone span { display: block; color: var(--sidebar-muted); font-size: 12px; line-height: 1.45; margin: 5px 0 10px; }
.dropzone input { background: transparent; border: 0; padding: 0; color: var(--sidebar-muted); }
.dropzone input::file-selector-button {
  margin-right: 10px;
  border: 1px solid #dcc59e;
  border-radius: 8px;
  background: #f8f2e6;
  color: #13211e;
  font-weight: 850;
  padding: 10px 12px;
  cursor: pointer;
}
.file-meta { display: grid; gap: 5px; margin-top: 9px; color: var(--sidebar-muted); font-size: 12px; }
.file-list { display: grid; gap: 4px; }
.file-list span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid var(--sidebar-line);
  border-radius: 7px;
  padding: 6px 8px;
  color: var(--sidebar-ink);
  background: #13211e;
}
.selection-progress {
  margin-top: 12px;
  border: 1px solid #dfe6e2;
  border-radius: 8px;
  padding: 12px;
  background: #f7fbfa;
  color: #17221f;
}
.progress-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.progress-head strong, .progress-head span { font-weight: 850; }
.progress-track {
  height: 9px;
  margin: 10px 0 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce6e2;
}
.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #159277, #2563eb);
  transition: width .22s ease;
}
.progress-detail {
  color: var(--muted);
  line-height: 1.35;
  font-size: 12px;
}
.actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
button {
  min-height: 43px;
  border: 1px solid #d7cbb7;
  border-radius: 8px;
  padding: 11px 14px;
  font-weight: 800;
  cursor: pointer;
  background: #fbf7ed;
  color: #151f1e;
}
button.primary { grid-column: 1 / -1; background: var(--green); border-color: var(--green); color: #fffaf0; }
button.primary:hover { background: var(--green-dark); }
button:disabled { cursor: not-allowed; background: #d8d2c4; color: #3f4642; }
.notice { min-height: 18px; margin: 10px 0 0; color: var(--sidebar-muted); font-size: 12px; line-height: 1.4; }
.notice.ok { color: #cbe8d7; }
.notice.error { color: #ffd5ce; }
.side-note { color: var(--sidebar-muted); font-size: 12px; line-height: 1.45; }
.side-note b { display: block; color: var(--sidebar-ink); margin-bottom: 4px; }

.main { min-width: 0; padding: 28px; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 24px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  padding-bottom: 24px;
}
.eyebrow { margin: 0 0 8px; color: var(--green); font-weight: 850; text-transform: uppercase; font-size: 12px; }
h1 { margin: 0; font-size: clamp(32px, 4vw, 56px); line-height: 1; }
.hero p:last-child { max-width: 850px; color: var(--muted); line-height: 1.6; font-size: 17px; }
.hero-panel {
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  padding: 18px;
  background: var(--panel);
}
.hero-panel span { display: block; color: var(--muted); font-size: 12px; font-weight: 850; text-transform: uppercase; }
.hero-panel strong { display: block; margin-top: 8px; font-size: 22px; line-height: 1.15; }

.coverage {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0;
}
.coverage article, .metric, .coverage-card, .executive-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel);
}
.coverage span, .metric span, .coverage-card span, .executive-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}
.coverage strong { display: block; margin-top: 7px; line-height: 1.25; }

.empty-state, .panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: var(--panel);
}
.empty-state strong { display: block; font-size: 24px; }
.empty-state > span { display: block; margin-top: 7px; color: var(--muted); }
.empty-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.empty-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8faf7;
}
.empty-grid b, .empty-grid small { display: block; }
.empty-grid small { color: var(--muted); margin-top: 5px; line-height: 1.35; }

.summary-head, .toolbar, .executive-strip {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}
.summary-head h2 { margin: 0 0 5px; font-size: 27px; }
.summary-head p { margin: 0; color: var(--muted); }
.status-pill {
  white-space: nowrap;
  border: 1px solid #bdd5cc;
  border-radius: 999px;
  padding: 8px 11px;
  color: var(--green-dark);
  background: var(--ok-bg);
  font-weight: 850;
}
.coverage-grid, .grid, .summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.summary-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.summary-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel);
}
.summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}
.summary-grid strong { display: block; font-size: 26px; margin-top: 4px; }
.grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.metric strong { display: block; font-size: 28px; }
.executive-strip { margin-top: 18px; align-items: stretch; }
.executive-card { flex: 1; }
.executive-card strong { display: block; margin-top: 7px; line-height: 1.35; }
.toolbar { margin-top: 18px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-btn { min-height: 36px; padding: 8px 11px; }
.filter-btn.is-active { background: var(--green); color: white; border-color: var(--green); }
.table-search { max-width: 360px; background: white; }

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; min-width: 1060px; background: white; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 13px; }
th { position: sticky; top: 0; background: #edf2ee; color: #273531; z-index: 1; }
code { font-family: Consolas, Monaco, monospace; font-size: 12px; }
.status-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 850;
}
.status-chip.ok { color: #12543d; background: var(--ok-bg); }
.status-chip.warning { color: #765016; background: var(--warn-bg); }
.status-chip.error { color: #842b2c; background: var(--bad-bg); }
.status-chip.info { color: #264d5a; background: #e7f3f6; }
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}
.badge.apto-local { color: #12543d; background: var(--ok-bg); }
.badge.observado-local { color: #765016; background: var(--warn-bg); }
.badge.rechazado-local { color: #842b2c; background: var(--bad-bg); }
.empty-row { display: none; padding: 16px; color: var(--muted); background: white; }

.result-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  margin-top: 12px;
}
.result-card summary {
  cursor: pointer;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
}
.doc-title { font-weight: 850; }
.doc-meta { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.doc-caret { color: var(--green); font-weight: 850; }
.detail-body { border-top: 1px solid var(--line); padding: 14px; }
.issue-table { min-width: 800px; }
.issue-table th { position: static; }
.severity-error td:first-child { border-left: 4px solid var(--red); }
.severity-warning td:first-child { border-left: 4px solid var(--orange); }
.severity-passed td:first-child { border-left: 4px solid var(--green); }
.privacy {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
  background: #f8faf7;
}
.privacy strong { color: var(--ink); margin-right: 8px; }
.file-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: white;
  margin-top: 14px;
}
.file-card h3 { margin: 0 0 12px; font-size: 18px; }
.meta-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.meta-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f8faf7;
  min-width: 0;
}
.meta-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}
.meta-grid strong {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.findings { display: grid; gap: 10px; }
.finding {
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
}
.finding.error { border-left-color: var(--bad); background: var(--bad-bg); }
.finding.warning { border-left-color: var(--warn); background: var(--warn-bg); }
.finding.info { border-left-color: var(--steel); background: #e7f3f6; }
.finding div { display: flex; gap: 9px; align-items: baseline; }
.finding span {
  font-size: 11px;
  font-weight: 900;
  color: var(--muted);
}
.finding b { font-size: 13px; }
.finding p { margin: 7px 0; }
.finding small { display: block; color: var(--muted); line-height: 1.4; }

@media (max-width: 1040px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .hero { grid-template-columns: 1fr; }
  .coverage, .coverage-grid, .grid, .empty-grid, .summary-grid, .meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .main { padding: 18px; }
  .coverage, .coverage-grid, .grid, .empty-grid, .summary-grid, .meta-grid { grid-template-columns: 1fr; }
  .summary-head, .toolbar, .executive-strip { display: grid; }
  .table-search { max-width: none; }
  .result-card summary { grid-template-columns: 1fr; }
}
