/* ── Reports — prefixo rp- ──────────────────────────────────────────────────── */

.rp-page {
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

/* ── Header ──────────────────────────────────────────────────────────────────── */

.rp-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rp-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .18s, transform .12s;
}

.rp-export-btn:hover { opacity: .9; transform: translateY(-1px); }

/* ── Cards ───────────────────────────────────────────────────────────────────── */

.rp-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.rp-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.07);
}

:root.dark-theme .rp-card { background: #1e293b; }

.rp-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.rp-card--ck .rp-card-icon { background: #eff6ff; color: #2563eb; }
.rp-card--wf .rp-card-icon { background: #f0fdf4; color: #16a34a; }
.rp-card--ap .rp-card-icon { background: #fff7ed; color: #ea580c; }

:root.dark-theme .rp-card--ck .rp-card-icon { background: #1e3a5f; color: #60a5fa; }
:root.dark-theme .rp-card--wf .rp-card-icon { background: #14532d; color: #4ade80; }
:root.dark-theme .rp-card--ap .rp-card-icon { background: #431407; color: #fb923c; }

.rp-card-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1;
}

:root.dark-theme .rp-card-value { color: #f1f5f9; }

.rp-card-label {
  display: block;
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 4px;
}

/* ── Abas ────────────────────────────────────────────────────────────────────── */

.rp-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 24px;
}

:root.dark-theme .rp-tabs { border-color: #334155; }

.rp-tab {
  background: none;
  border: none;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  border-radius: 6px 6px 0 0;
  transition: color .15s, border-color .15s, background .15s;
}

.rp-tab:hover { color: #f97316; background: #fff7ed; }
.rp-tab.active { color: #f97316; border-color: #f97316; font-weight: 600; }

:root.dark-theme .rp-tab:hover { background: #1e293b; }

/* ── Filtros ─────────────────────────────────────────────────────────────────── */

.rp-filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
  background: #fff;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

:root.dark-theme .rp-filters-bar { background: #1e293b; }

.rp-filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 150px;
}

.rp-filter-group--search { flex: 1 1 220px; }

.rp-filter-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.rp-filter-actions {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding-top: 20px;
}

.rp-date-pair {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rp-date-sep {
  font-size: 0.8rem;
  color: #94a3b8;
  flex-shrink: 0;
}

.rp-date-input {
  padding: 8px 10px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #1e293b;
  background: #f8fafc;
  transition: border-color .15s;
  width: 130px;
}

.rp-date-input:focus { border-color: #f97316; outline: none; background: #fff; }

:root.dark-theme .rp-date-input { background: #0f172a; border-color: #334155; color: #f1f5f9; }

.rp-select {
  padding: 8px 10px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #1e293b;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color .15s;
  width: 100%;
}

.rp-select:focus { border-color: #f97316; outline: none; background: #fff; }

:root.dark-theme .rp-select { background: #0f172a; border-color: #334155; color: #f1f5f9; }

.rp-search-wrap {
  position: relative;
  width: 100%;
}

.rp-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.85rem;
  pointer-events: none;
}

.rp-search-input {
  width: 100%;
  padding: 8px 10px 8px 32px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #1e293b;
  background: #f8fafc;
  transition: border-color .15s;
  box-sizing: border-box;
}

.rp-search-input:focus { border-color: #f97316; outline: none; background: #fff; }

:root.dark-theme .rp-search-input { background: #0f172a; border-color: #334155; color: #f1f5f9; }

/* ── Botões ───────────────────────────────────────────────────────────────────── */

.rp-btn-primary {
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  white-space: nowrap;
}

.rp-btn-primary:hover { opacity: .9; transform: translateY(-1px); }
.rp-btn-primary:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.rp-btn-outline {
  background: transparent;
  color: #64748b;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, color .15s;
  white-space: nowrap;
}

.rp-btn-outline:hover { border-color: #f97316; color: #f97316; }

:root.dark-theme .rp-btn-outline { border-color: #334155; color: #94a3b8; }
:root.dark-theme .rp-btn-outline:hover { border-color: #f97316; color: #f97316; }

/* ── Tabela ───────────────────────────────────────────────────────────────────── */

.rp-table-wrap {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.07);
  overflow: hidden;
}

:root.dark-theme .rp-table-wrap { background: #1e293b; }

.rp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.rp-table thead th {
  padding: 13px 14px;
  background: #f8fafc;
  color: #64748b;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  text-align: left;
  border-bottom: 1.5px solid #e2e8f0;
}

:root.dark-theme .rp-table thead th {
  background: #0f172a;
  color: #94a3b8;
  border-color: #334155;
}

.rp-table tbody tr {
  transition: background .12s;
  border-bottom: 1px solid #f1f5f9;
}

.rp-table tbody tr:last-child { border-bottom: none; }
.rp-table tbody tr:hover { background: #fff7ed; }

:root.dark-theme .rp-table tbody tr { border-color: #1e293b; }
:root.dark-theme .rp-table tbody tr:hover { background: #1a2740; }

.rp-table tbody td {
  padding: 12px 14px;
  color: #334155;
  vertical-align: middle;
}

:root.dark-theme .rp-table tbody td { color: #cbd5e1; }

.rp-loading {
  text-align: center;
  color: #94a3b8;
  padding: 40px !important;
  font-size: 0.9rem;
}

/* ── Badges ──────────────────────────────────────────────────────────────────── */

.rp-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 600;
}

.rp-badge--urgente { background: #fee2e2; color: #dc2626; }
.rp-badge--alta    { background: #ffedd5; color: #ea580c; }
.rp-badge--media   { background: #fef9c3; color: #ca8a04; }
.rp-badge--baixa   { background: #dcfce7; color: #16a34a; }
.rp-badge--normal  { background: #f1f5f9; color: #64748b; }

:root.dark-theme .rp-badge--urgente { background: #450a0a; color: #f87171; }
:root.dark-theme .rp-badge--alta    { background: #431407; color: #fb923c; }
:root.dark-theme .rp-badge--media   { background: #422006; color: #fbbf24; }
:root.dark-theme .rp-badge--baixa   { background: #052e16; color: #4ade80; }
:root.dark-theme .rp-badge--normal  { background: #1e293b; color: #94a3b8; }

.rp-nc-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 700;
}

.rp-nc-count--zero { background: #f1f5f9; color: #94a3b8; }
.rp-nc-count--has  { background: #fee2e2; color: #dc2626; }

:root.dark-theme .rp-nc-count--zero { background: #1e293b; color: #64748b; }
:root.dark-theme .rp-nc-count--has  { background: #450a0a; color: #f87171; }

/* ── Paginação ───────────────────────────────────────────────────────────────── */

.rp-pagination-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #fff;
  border-top: 1px solid #f1f5f9;
  flex-wrap: wrap;
  gap: 10px;
}

:root.dark-theme .rp-pagination-wrap { background: #1e293b; border-color: #334155; }

.rp-pagination-info {
  font-size: 0.83rem;
  color: #64748b;
}

/* ── Modal overlay ───────────────────────────────────────────────────────────── */

.rp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.55);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.rp-modal {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

:root.dark-theme .rp-modal { background: #1e293b; }

.rp-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #e2e8f0;
}

:root.dark-theme .rp-modal-header { border-color: #334155; }

.rp-modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

:root.dark-theme .rp-modal-title { color: #f1f5f9; }

.rp-modal-close-btn {
  background: none;
  border: none;
  font-size: 1rem;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color .15s, background .15s;
}

.rp-modal-close-btn:hover { color: #ef4444; background: #fee2e2; }

.rp-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rp-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid #e2e8f0;
}

:root.dark-theme .rp-modal-footer { border-color: #334155; }

/* ── Modal — campos ──────────────────────────────────────────────────────────── */

.rp-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  position: relative;
}

.rp-field--with-preview { position: relative; }

.rp-field-row {
  display: flex;
  gap: 12px;
}

.rp-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.rp-text-input {
  padding: 9px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.88rem;
  color: #1e293b;
  background: #f8fafc;
  transition: border-color .15s;
  width: 100%;
  box-sizing: border-box;
}

.rp-text-input:focus { border-color: #f97316; outline: none; background: #fff; }

:root.dark-theme .rp-text-input { background: #0f172a; border-color: #334155; color: #f1f5f9; }

/* ── Preview de busca ────────────────────────────────────────────────────────── */

.rp-modal-preview {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  max-height: 180px;
  overflow-y: auto;
  z-index: 10;
  font-size: 0.85rem;
}

:root.dark-theme .rp-modal-preview { background: #0f172a; border-color: #334155; }

.rp-modal-preview-row {
  padding: 9px 14px;
  cursor: pointer;
  color: #334155;
  transition: background .1s;
}

.rp-modal-preview-row:hover { background: #fff7ed; color: #f97316; }

:root.dark-theme .rp-modal-preview-row { color: #cbd5e1; }
:root.dark-theme .rp-modal-preview-row:hover { background: #1a2740; }

.rp-modal-preview-empty {
  padding: 12px 14px;
  color: #94a3b8;
  font-size: 0.83rem;
}

/* ── Formato ─────────────────────────────────────────────────────────────────── */

.rp-format-group {
  display: flex;
  gap: 8px;
}

.rp-format-btn {
  padding: 8px 20px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}

.rp-format-btn:hover { border-color: #f97316; color: #f97316; }
.rp-format-btn.active { border-color: #f97316; background: #fff7ed; color: #f97316; }

:root.dark-theme .rp-format-btn { border-color: #334155; color: #94a3b8; }
:root.dark-theme .rp-format-btn.active { background: #431407; border-color: #f97316; color: #fb923c; }
