:root {
  --navy-deep: #0B2545;
  --navy: #123A6B;
  --navy-dark: #123A6B;
  --navy-light: #1E56A0;
  --gold: #F2A900;
  --gold-dim: rgba(242,169,0,0.14);
  --green: #168250;
  --green-bg: #E0F5EA;
  --amber: #B46E0A;
  --amber-bg: #FFEDCC;
  --red: #BE2828;
  --red-bg: #FDE2E2;
  --gray: #5D6B82;
  --dark-text: #101828;
  --border: #ECE5D8;
  --zebra: #FBF8F2;
  --bg-page: #FBF8F2;
  --blue-light: #EAF0F8;
  --pgm-blue: #1E3F94;
  --pgm-green: #4CA046;
  --pgm-yellow: #F0C33B;
  --shadow-sm: 0 1px 2px rgba(34,28,18,0.05);
  --shadow-md: 0 4px 14px rgba(34,28,18,0.06), 0 1px 2px rgba(34,28,18,0.04);
  --shadow-lg: 0 16px 40px rgba(18,58,107,0.16);
  --radius: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Public Sans', -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg-page);
  color: var(--dark-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.005em;
}

a { color: var(--pgm-blue); }
a:hover { color: var(--navy-dark); }

/* ---------- Marca / Identidade visual ---------- */
.brand-row {
  display: flex;
  align-items: flex-start;
}

.brand-letter {
  font-size: 20px;
  font-weight: 800;
  color: var(--navy-dark);
  line-height: 1;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-text {
  margin-left: 12px;
  margin-top: 2px;
}

.brand-name-line {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
}

/* ---------- Layout geral ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--navy-dark);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  z-index: 1;
  margin: 14px 0 14px 14px;
  border-radius: 22px;
  min-height: calc(100vh - 28px);
}

.sidebar-header {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo {
  height: 28px;
  width: auto;
  background: #fff;
  border-radius: 4px;
  padding: 3px 6px;
}

.sidebar-title {
  color: #fff;
  font-weight: 700;
  font-size: 16px;
}

.sidebar-subtitle {
  color: rgba(255,255,255,0.55);
  font-size: 11px;
  font-weight: 600;
  margin-top: 12px;
  line-height: 1.3;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 12px;
  padding: 8px 12px;
  color: rgba(255,255,255,0.82);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  position: relative;
  border-radius: 14px;
  transition: background-color .16s ease, color .16s ease;
}

.nav-item svg { flex-shrink: 0; }

.nav-icon-chip {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.nav-item.active {
  background: var(--gold);
  color: var(--navy-dark);
}

.nav-item.active .nav-icon-chip {
  background: rgba(255,255,255,0.35) !important;
}

.nav-item.active .nav-icon-chip svg {
  color: var(--navy-dark) !important;
}

.nav-item.active:hover {
  background: var(--gold);
  color: var(--navy-dark);
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-user-avatar {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--gold) 0%, #D99400 100%);
  color: var(--navy-dark);
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-user-name {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.sidebar-user-role {
  color: rgba(255,255,255,0.55);
  font-size: 11px;
}

.sidebar-logout {
  display: inline-block;
  margin-top: 8px;
  color: var(--gold);
  font-size: 12px;
  text-decoration: none;
}

.main-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: 64px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(16,24,40,0.02), 0 2px 8px rgba(16,24,40,0.03);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.015em;
  margin: 0;
}

.topbar-meta {
  font-size: 12px;
  color: var(--gray);
  white-space: nowrap;
}

.topbar-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--navy-dark);
  cursor: pointer;
  flex-shrink: 0;
}

.topbar-menu-btn:hover { background: var(--blue-light); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(11,37,69,0.45);
  z-index: 190;
}

.content {
  padding: 28px 32px 40px;
  max-width: 1320px;
}

/* ---------- Flash messages ---------- */
.flash-stack { margin-bottom: 16px; display: flex; flex-direction: column; gap: 8px; }
.flash { padding: 10px 14px; border-radius: 6px; font-size: 13px; }
.flash-success { background: var(--green-bg); color: var(--green); }
.flash-warning { background: var(--amber-bg); color: var(--amber); }
.flash-danger { background: var(--red-bg); color: var(--red); }
.flash-info { background: #E5EBF5; color: var(--navy); }

/* ---------- KPI strip ---------- */
.kpi-row {
  display: flex;
  gap: 14px;
  margin-bottom: 22px;
}

.kpi-block {
  flex: 1;
  padding: 20px 22px;
  background: #E4EBF7;
  border: none;
  border-radius: var(--radius);
  transition: transform .15s ease;
}

.kpi-block:hover { transform: translateY(-2px); }

.kpi-value { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; color: var(--dark-text); }
.kpi-label { font-size: 12px; font-weight: 600; letter-spacing: .2px; margin-top: 4px; color: var(--gray); }

.kpi-navy { background: #E4EBF7; }
.kpi-amber { background: #FCEED3; }
.kpi-red { background: #FCE4E4; }
.kpi-green { background: #DCF2E5; }

/* ---------- Selo de urgência ao lado do título ---------- */
.page-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
  padding: 4px 10px;
  border-radius: 20px;
  vertical-align: middle;
  margin-left: 8px;
}
.page-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.page-tag-red { background: var(--red-bg); color: var(--red); }
.page-tag-amber { background: var(--amber-bg); color: var(--amber); }

/* ---------- Tabela densa ---------- */
.data-table-wrap {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.data-table tbody tr { transition: background-color .12s ease; }
table.data-table tbody tr:hover { background: var(--blue-light); }

table.data-table thead {
  background: #FBF8F2;
}

table.data-table thead th {
  color: var(--gray);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  text-align: left;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
}

table.data-table tbody td {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
}

table.data-table tbody tr:nth-child(even) { background: var(--zebra); }

/* ---------- Estado vazio ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 44px 24px;
  color: var(--gray);
}
.empty-state-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--green-bg);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
}
.empty-state-title { font-size: 14px; font-weight: 700; color: var(--dark-text); }
.empty-state-desc { font-size: 14px; max-width: 340px; text-align: center; line-height: 1.55; }

/* ---------- Avatar de iniciais em linhas de tabela ---------- */
.row-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
  flex-shrink: 0;
  margin-right: 8px;
  vertical-align: middle;
}
.row-person { display: inline-flex; align-items: center; }

/* ---------- Badges de status ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px 6px 8px; border-radius: 20px; font-size: 10.5px; font-weight: 700; letter-spacing: .3px; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.badge-pendente { background: var(--amber-bg); color: var(--amber); }
.badge-cumprido { background: var(--green-bg); color: var(--green); }
.badge-vencido { background: var(--red-bg); color: var(--red); }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .15s ease, box-shadow .15s ease, transform .1s ease, opacity .15s ease;
}

.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--navy-dark); color: #fff; }
.btn-primary:hover { background: var(--navy-deep); box-shadow: var(--shadow-sm); }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #12744a; box-shadow: var(--shadow-sm); }
.btn-outline { background: #fff; border: 1px solid var(--border); color: var(--dark-text); }
.btn-outline:hover { border-color: var(--navy-dark); background: var(--blue-light); }
.btn svg { vertical-align: -2px; flex-shrink: 0; }

/* ---------- Cards ---------- */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.card + .card { margin-top: 14px; }

.card-row { display: flex; gap: 14px; }
.card-row .card { flex: 1; }

/* ---------- Relatórios ---------- */
.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.report-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
  transition: box-shadow .18s ease, transform .18s ease;
}

.report-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.report-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.report-card-title {
  font-size: 16px;
  margin-bottom: 6px;
}

.report-card-desc {
  color: var(--gray);
  font-size: 12.5px;
  line-height: 1.5;
  margin: 0 0 18px;
  flex: 1;
}

.report-card-actions {
  display: flex;
  gap: 8px;
}

.report-card-actions .btn {
  display: inline-flex;
  flex: 1;
  justify-content: center;
}

@media (max-width: 640px) {
  .report-grid { grid-template-columns: 1fr; }
}

/* ---------- Dropzone de upload de planilha ---------- */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 36px 20px;
  border: 2px dashed var(--border);
  border-radius: 10px;
  background: #FAFBFC;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.dropzone:hover {
  border-color: var(--navy-dark);
  background: #F2F5FA;
}

.dropzone-ativa {
  border-color: var(--green);
  background: var(--green-bg);
}

.dropzone-com-arquivo {
  border-style: solid;
  border-color: var(--green);
  background: var(--green-bg);
}

.dropzone-text strong {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}

.dropzone-text span {
  font-size: 12.5px;
  color: var(--gray);
}

/* ---------- Barra de filtros/ações (toolbar) ---------- */
.toolbar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
}

.toolbar-fields {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

@media (max-width: 720px) {
  .toolbar-actions {
    width: 100%;
    justify-content: flex-start;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
  }
}

/* ---------- Formulários ---------- */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 5px; }
.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--pgm-blue);
  box-shadow: 0 0 0 3px rgba(30,63,148,0.12);
}

/* ---------- Login ---------- */
.login-shell { display: flex; min-height: 100vh; }
.login-side {
  width: 45%;
  background: linear-gradient(160deg, var(--navy-dark) 0%, var(--navy-light) 120%);
  background-image: linear-gradient(160deg, var(--navy-dark) 0%, var(--navy-light) 120%),
    radial-gradient(circle at 100% 0%, rgba(242,169,0,0.16) 0%, transparent 45%),
    radial-gradient(circle, rgba(255,255,255,0.06) 1px, transparent 1.4px);
  background-size: auto, auto, 16px 16px;
  color: #fff;
  padding: 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}
.login-badge {
  display: inline-block;
  background: var(--gold);
  color: #17120a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 6px 14px;
  border-radius: 4px;
  width: fit-content;
}
.login-brand-row { display: flex; align-items: flex-start; }
.login-brand-letter {
  font-size: 64px;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
  letter-spacing: -0.04em;
  flex-shrink: 0;
}
.login-brand-text { margin-left: 10px; margin-top: 6px; }
.login-brand-line {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  line-height: 1.35;
}
.login-pgm-subtitle {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  font-weight: 600;
  margin-top: 18px;
}
.login-side h1 { font-size: 34px; line-height: 1.2; margin: 28px 0 0; }
.login-side p { color: rgba(255,255,255,0.8); font-size: 14px; max-width: 380px; }
.login-form-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}
.login-form { width: 380px; background: #fff; border-radius: var(--radius); padding: 8px; }
.login-form h2 { font-size: 24px; margin-bottom: 4px; }
.login-form .subtitle { color: var(--gray); font-size: 13px; margin-bottom: 20px; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-box {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  width: 400px;
  max-width: 90vw;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  animation: modal-in .15s ease;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(6px) scale(.98); }
  to { opacity: 1; transform: none; }
}

/* ---------- Gráficos (Produtividade) ---------- */
.chart-row {
  display: flex;
  gap: 14px;
}

.chart-card {
  flex: 1;
  min-width: 0;
}

.chart-card-wide {
  flex: 2;
}

.chart-card strong {
  display: block;
  margin-bottom: 14px;
}

/* ---------- Hero da tela Início (relógio + frase) ---------- */
.welcome-header {
  margin-bottom: 16px;
}

.welcome-title {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--navy-dark);
  margin: 0;
}

.hero-card {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy-light) 140%);
  border-radius: 16px;
  display: flex;
  overflow: hidden;
  margin-bottom: 28px;
  box-shadow: var(--shadow-lg);
}

.hero-text {
  flex: 1;
  padding: 40px 44px;
  position: relative;
  background-image: radial-gradient(circle at 100% 0%, rgba(242,169,0,0.12) 0%, transparent 45%),
    radial-gradient(circle, rgba(255,255,255,0.05) 1px, transparent 1.4px);
  background-size: auto, 16px 16px;
}

.hero-datetime {
  font-size: 12px;
  font-weight: 600;
  color: #7FA8E0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 14px;
}

.hero-quote {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 24px;
  font-style: italic;
  color: #fff;
  line-height: 1.45;
  margin: 0;
  max-width: 640px;
}

.hero-author {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  margin-top: 14px;
  letter-spacing: 0.02em;
}

.hero-day {
  background: linear-gradient(160deg, var(--gold) 0%, #D99400 100%);
  width: 140px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Georgia, serif;
  font-size: 72px;
  font-weight: 700;
  color: var(--navy-dark);
}

/* ---------- Acesso rápido (Início) ---------- */
.section-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy-dark);
  margin-bottom: 12px;
}

.quick-access-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.quick-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px 20px;
  text-decoration: none;
  display: block;
  box-shadow: var(--shadow-sm);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}

.quick-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: #D9E0EC;
}

.quick-card svg {
  display: block;
  width: 22px;
  height: 22px;
  padding: 9px;
  box-sizing: content-box;
  border-radius: 9px;
  background: var(--gold-dim);
  margin-bottom: 16px;
}

.quick-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--dark-text);
}

@media (max-width: 900px) {
  .hero-card { flex-direction: column; }
  .hero-day { width: 100%; padding: 20px 0; font-size: 48px; }
  .quick-access-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== Produtividade: faixa de insights ===== */
.insight-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.insight {
  position: relative;
  background: #E4EBF7;
  border: none;
  border-radius: 14px;
  padding: 14px 16px 14px 38px;
  font-size: 14px;
  line-height: 1.55;
  color: #1C2733;
}
.insight::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 17px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pgm-blue);
}
.insight b { color: inherit; }
.insight.warn { background: #FCEED3; }
.insight.warn::before { background: var(--amber); }
.insight.bad { background: #FCE4E4; }
.insight.bad::before { background: var(--red); }
.insight.good { background: #DCF2E5; }
.insight.good::before { background: var(--green); }

/* ===== Produtividade: cards de KPI (React) ===== */
.kpi-h-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.kpi-h-card {
  background: #E4EBF7;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 16px 16px 14px;
  transition: transform .15s ease;
}
.kpi-h-card:has(.dot-amber) { background: #FCEED3; }
.kpi-h-card:has(.dot-red) { background: #FCE4E4; }
.kpi-h-card:has(.dot-green) { background: #DCF2E5; }
.kpi-h-card:hover { transform: translateY(-2px); }
.kpi-h-card-expanded {
  border-color: rgba(18,58,107,0.14);
}
.kpi-h-top {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
}
.kpi-h-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.kpi-h-dot.dot-navy { background: var(--navy-dark); }
.kpi-h-dot.dot-amber { background: var(--amber); }
.kpi-h-dot.dot-red { background: var(--red); }
.kpi-h-dot.dot-green { background: var(--green); }
.kpi-h-label { font-size: 12.5px; color: #445068; font-weight: 500; flex: 1; }
.kpi-h-info { font-size: 12px; color: #B7C0CE; }
.kpi-h-val {
  font-size: 26px; font-weight: 700; color: #16202E; line-height: 1;
  margin-bottom: 12px; letter-spacing: -0.01em;
}
.kpi-h-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
.kpi-h-link { font-size: 11.5px; color: var(--gray); text-decoration: none; cursor: pointer; white-space: nowrap; }
.kpi-h-link:hover { color: var(--navy-dark); }
.kpi-h-pill { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.kpi-h-pill.pill-flat { background: #F0F2F6; color: #5D6B82; }
.kpi-h-pill.pill-bad { background: var(--red-bg); color: var(--red); }
.kpi-h-pill.pill-good { background: var(--green-bg); color: var(--green); }
.kpi-h-expand {
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed #E4E8EF;
  font-size: 11.5px; color: var(--gray); line-height: 1.5;
}
@media (max-width: 900px) {
  .kpi-h-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== Responsivo: sidebar retrátil em tablet/celular ===== */
@media (max-width: 880px) {
  .topbar-menu-btn { display: flex; }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    margin: 0;
    border-radius: 0;
    min-height: 100vh;
    transform: translateX(-100%);
    transition: transform .22s ease;
    z-index: 200;
  }

  .sidebar.open { transform: translateX(0); }

  .sidebar-overlay.open { display: block; }

  .topbar { padding: 0 16px; }
  .content { padding: 20px 16px 32px; }

  .kpi-row { flex-wrap: wrap; }
  .kpi-block { min-width: 150px; }

  .card-row { flex-direction: column; }
  .chart-row { flex-direction: column; }

  .quick-access-grid { grid-template-columns: repeat(2, 1fr); }

  .data-table-wrap { overflow-x: auto; }
  table.data-table { min-width: 640px; }
}

@media (max-width: 480px) {
  .topbar-title { font-size: 16px; }
  .topbar-meta { display: none; }
  .quick-access-grid { grid-template-columns: 1fr; }
  .hero-text { padding: 28px 24px; }
  .hero-quote { font-size: 19px; }
}
