:root {
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f8fafc;
  color: #0f172a;
}

* { box-sizing: border-box; }
body { margin: 0; background: #f8fafc; color: #0f172a; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; padding: 18px; }
.container { max-width: 1480px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 22px;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.05);
}
.hidden { display: none !important; }

.hero {
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.eyebrow {
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .72rem;
  color: #64748b;
  font-weight: 700;
}
.hero h1 {
  margin: 0;
  font-size: clamp(1.55rem, 2vw, 2rem);
  line-height: 1.12;
}
.hero-description { margin: 6px 0 0; color: #475569; max-width: 760px; }
.hero-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 700;
}
.pill.orange { background: #ffedd5; color: #c2410c; }
.pill.purple { background: #ede9fe; color: #6d28d9; }
.pill.slate { background: #e2e8f0; color: #334155; }

.toolbar {
  padding: 14px 18px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.tabs {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  background: #f1f5f9;
  border-radius: 16px;
}
.tab-btn {
  border: none;
  background: transparent;
  color: #475569;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
}
.tab-btn.active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}
.toolbar-actions { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.search-field { display: flex; flex-direction: column; gap: 6px; min-width: min(380px, 100%); }
.search-field span, .field span { font-weight: 700; color: #334155; font-size: .92rem; }
.search-field input, .field input, .field select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  padding: 12px 14px;
  background: #fff;
  color: #0f172a;
  outline: none;
}
.search-field input:focus, .field select:focus {
  border-color: #f97316;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}
.secondary-button, .link-button {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  border-radius: 14px;
  padding: 11px 14px;
}
.link-button { border: none; color: #ea580c; font-weight: 700; padding: 0; background: transparent; }

.filters-panel { padding: 18px; }
.filters-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.filters-header h2 { margin: 0 0 4px; font-size: 1rem; }
.filters-header p { margin: 0; color: #64748b; }
.filters-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.field { display: flex; flex-direction: column; gap: 8px; }

.view-grid { display: flex; flex-direction: column; gap: 14px; }
.summary-row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.summary-chip {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.summary-chip strong { font-size: 1.7rem; line-height: 1; }
.summary-chip span { color: #64748b; font-size: .92rem; }
.summary-chip p { margin: 0; color: #334155; font-weight: 700; }

.section-card { padding: 18px; }
.section-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.section-header h2 { margin: 0 0 4px; font-size: 1.15rem; }
.section-header p { margin: 0; color: #64748b; }
.helper-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  background: #fff7ed;
  color: #c2410c;
  padding: 8px 12px;
  font-size: .88rem;
  font-weight: 700;
}
.table-wrap { overflow-x: auto; }
.table-wrap table { width: 100%; border-collapse: collapse; min-width: 980px; }
.table-wrap thead th {
  text-align: left;
  padding: 12px 14px;
  font-size: .84rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
}
.table-wrap tbody tr { border-bottom: 1px solid #e2e8f0; }
.table-wrap tbody tr:last-child { border-bottom: none; }
.table-wrap tbody td { padding: 14px; vertical-align: middle; }
.table-wrap tbody tr.status-critical { background: linear-gradient(90deg, #fff1f2, #ffffff 32%); }
.table-wrap tbody tr.status-warning { background: linear-gradient(90deg, #fff7ed, #ffffff 32%); }
.loja-cell { min-width: 300px; }
.loja-cell strong { display: block; }
.loja-cell span { color: #64748b; font-size: .88rem; }
.strong-cell { font-weight: 800; }

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 800;
}
.pill-critical { background: #fee2e2; color: #b91c1c; }
.pill-warning { background: #ffedd5; color: #c2410c; }
.pill-success { background: #dcfce7; color: #166534; }
.pill-highlight { background: #ccfbf1; color: #115e59; }
.text-danger { color: #b91c1c; font-weight: 800; }
.text-success { color: #166534; font-weight: 800; }

.two-column {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 14px;
}
.list-stack { display: flex; flex-direction: column; gap: 10px; }
.list-item {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.list-item strong { display: block; }
.list-item span { color: #64748b; font-size: .9rem; }
.kpi-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.kpi-card {
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 16px;
}
.kpi-card p { margin: 0 0 6px; color: #64748b; }
.kpi-card strong { font-size: 1.8rem; }
.progress-list { display: flex; flex-direction: column; gap: 14px; }
.progress-row { display: flex; flex-direction: column; gap: 8px; }
.progress-meta { display: flex; justify-content: space-between; gap: 12px; }
.progress-track { height: 12px; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #fb923c, #ea580c); }
.progress-bar.good { background: linear-gradient(90deg, #4ade80, #16a34a); }
.progress-bar.warn { background: linear-gradient(90deg, #fdba74, #f97316); }
.progress-bar.bad { background: linear-gradient(90deg, #fda4af, #ef4444); }
.note-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.note-strip .pill { font-size: .82rem; }
.empty-state { padding: 18px; border: 1px dashed #cbd5e1; border-radius: 18px; color: #64748b; text-align: center; }

@media (max-width: 1100px) {
  .summary-row, .kpi-grid, .filters-grid, .two-column { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .app-shell { padding: 12px; }
  .summary-row, .kpi-grid, .filters-grid, .two-column { grid-template-columns: 1fr; }
  .toolbar-actions, .search-field { width: 100%; }
  .search-field { min-width: 0; }
  .hero, .toolbar { padding: 16px; }
}
