/* ── Rastreio NF Portal – Public CSS ────────────────────────────────────── */
:root { --p: #1d4ed8; }
.rnfp-wrap { font-family: inherit; max-width: 780px; margin: 0 auto; padding: 0 0 40px; }

/* Alertas globais */
.rnfp-alert { padding: 12px 18px; border-radius: 8px; margin-bottom: 20px; font-size: 14px; font-weight: 500; }
.rnfp-alert.success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.rnfp-alert.error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.rnfp-alert.warn    { background: #fef9c3; color: #854d0e; border: 1px solid #fde68a; }

/* Card (login/cadastro/recuperar) */
.rnfp-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 36px 40px; max-width: 420px; margin: 0 auto; box-shadow: 0 2px 16px rgba(0,0,0,.07); }
.rnfp-card-logo   { font-size: 36px; text-align: center; margin-bottom: 10px; }
.rnfp-card-titulo { margin: 0 0 6px; font-size: 1.4rem; text-align: center; font-weight: 600; }
.rnfp-card-sub    { margin: 0 0 24px; color: #64748b; font-size: 14px; text-align: center; }

/* Fields */
.rnfp-field       { margin-bottom: 16px; }
.rnfp-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.rnfp-field small { font-weight: 400; color: #94a3b8; }
.rnfp-field input { width: 100%; padding: 10px 14px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 14px; box-sizing: border-box; transition: border-color .2s; }
.rnfp-field input:focus { outline: none; border-color: var(--p); box-shadow: 0 0 0 3px rgba(29,78,216,.12); }

/* Botões */
.rnfp-btn-primary  { width: 100%; background: var(--p); color: #fff; border: none; padding: 12px; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 4px; transition: opacity .2s; }
.rnfp-btn-primary:hover   { opacity: .88; }
.rnfp-btn-primary:disabled{ opacity: .6; cursor: not-allowed; }
.rnfp-btn-secondary{ background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; padding: 8px 16px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.rnfp-btn-secondary:hover { background: #e2e8f0; }

/* Links */
.rnfp-links { text-align: center; margin-top: 18px; font-size: 13px; color: #94a3b8; display: flex; gap: 8px; justify-content: center; align-items: center; }
.rnfp-links a { color: var(--p); text-decoration: none; font-weight: 500; }
.rnfp-links a:hover { text-decoration: underline; }

/* Mensagem form */
.rnfp-msg { padding: 11px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; font-weight: 500; }
.rnfp-msg.error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.rnfp-msg.success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }

/* ── Painel ── */
.rnfp-painel-header { display: flex; justify-content: space-between; align-items: center; background: var(--p); color: #fff; padding: 16px 22px; border-radius: 12px; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.rnfp-painel-logo  { font-size: 22px; margin-right: 8px; }
.rnfp-painel-nome  { font-size: 15px; }
.rnfp-cnpj-badge   { background: rgba(255,255,255,.2); padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.rnfp-btn-logout   { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.3); padding: 6px 14px; border-radius: 8px; font-size: 12px; cursor: pointer; }
.rnfp-btn-logout:hover { background: rgba(255,255,255,.25); }

/* Filtros painel */
.rnfp-painel-filtros { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.rnfp-search-input { flex: 1; min-width: 180px; padding: 9px 14px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 13px; }
.rnfp-select       { padding: 9px 12px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 13px; background: #fff; }

/* Cards de nota */
#rnfp-lista-notas  { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.rnfp-nota-card    { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 18px 20px; transition: box-shadow .2s; }
.rnfp-nota-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.09); }
.rnfp-nota-top     { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.rnfp-nota-num     { display: block; font-size: 16px; margin-bottom: 3px; }
.rnfp-nota-data    { display: block; font-size: 11px; color: #94a3b8; }
.rnfp-nota-bottom  { display: flex; justify-content: space-between; align-items: center; }
.rnfp-nota-canhoto { font-size: 11px; color: #16a34a; font-weight: 500; }
.rnfp-btn-detalhe  { background: none; border: 1px solid #e2e8f0; color: var(--p); padding: 6px 12px; border-radius: 6px; font-size: 12px; cursor: pointer; font-weight: 500; }
.rnfp-btn-detalhe:hover { background: #eff6ff; }

/* Badges */
.rnfp-badge { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.rnfp-badge.coletado     { background: #fef3c7; color: #92400e; }
.rnfp-badge.em_andamento { background: #dbeafe; color: #1e40af; }
.rnfp-badge.entregue     { background: #dcfce7; color: #166534; }
.rnfp-badge-grande { display: inline-block; padding: 7px 18px; border-radius: 999px; font-weight: 700; font-size: 14px; white-space: nowrap; }
.rnfp-badge-grande.coletado     { background: #fef3c7; color: #92400e; }
.rnfp-badge-grande.em_andamento { background: #dbeafe; color: #1e40af; }
.rnfp-badge-grande.entregue     { background: #dcfce7; color: #166534; }

/* Voltar */
.rnfp-btn-voltar { background: none; border: none; color: var(--p); font-size: 14px; font-weight: 500; cursor: pointer; padding: 0; margin-bottom: 16px; display: inline-flex; align-items: center; gap: 4px; }
.rnfp-btn-voltar:hover { text-decoration: underline; }

/* Detalhe */
.rnfp-detalhe-card   { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 28px; }
.rnfp-detalhe-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }

/* Progress (reutiliza do plugin principal) */
.rnfp-progress { display: flex; align-items: flex-start; margin: 0 0 24px; }
.rnfp-step     { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 90px; }
.rnfp-step-dot { width: 44px; height: 44px; border-radius: 50%; background: #e2e8f0; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; margin-bottom: 6px; }
.rnfp-step span  { font-size: 11px; font-weight: 600; color: #94a3b8; }
.rnfp-step small { font-size: 10px; color: #94a3b8; }
.rnfp-step.ativo    .rnfp-step-dot { background: #dbeafe; }
.rnfp-step.ativo    span           { color: #1e40af; }
.rnfp-step.concluido .rnfp-step-dot{ background: #dcfce7; }
.rnfp-step.concluido span          { color: #166534; }
.rnfp-step-line       { flex: 1; height: 3px; background: #e2e8f0; margin-top: 21px; border-radius: 2px; }
.rnfp-step-line.ativa { background: var(--p); }

.rnfp-obs-box     { background: #f8fafc; border-left: 4px solid #94a3b8; padding: 12px 16px; border-radius: 0 8px 8px 0; margin: 16px 0; font-size: 13px; }
.rnfp-canhoto-box { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; padding: 18px; margin: 16px 0; text-align: center; }
.rnfp-canhoto-box h4 { margin: 0 0 12px; font-size: 14px; }
.rnfp-btn-canhoto { display: inline-block; background: #16a34a; color: #fff !important; padding: 10px 22px; border-radius: 8px; font-weight: 600; text-decoration: none; font-size: 14px; }

.rnfp-historico-box h4 { margin: 20px 0 12px; font-size: 14px; }
.rnfp-timeline-pub { list-style: none; padding: 0; margin: 0; }
.rnfp-timeline-pub li { display: flex; gap: 12px; margin-bottom: 14px; }
.rnfp-tl-pub-dot { width: 12px; height: 12px; border-radius: 50%; background: #cbd5e1; flex-shrink: 0; margin-top: 4px; }
.rnfp-tl-pub-dot.coletado     { background: #d97706; }
.rnfp-tl-pub-dot.em_andamento { background: #2563eb; }
.rnfp-tl-pub-dot.entregue     { background: #16a34a; }
.rnfp-tl-pub-body strong { font-size: 13px; }
.rnfp-tl-pub-body time   { display: block; font-size: 11px; color: #94a3b8; }
.rnfp-tl-pub-body p      { margin: 3px 0 0; font-size: 12px; color: #475569; }

@media (max-width: 520px) {
  .rnfp-card { padding: 24px 18px; }
  .rnfp-painel-header { border-radius: 8px; }
  #rnfp-lista-notas { grid-template-columns: 1fr; }
  .rnfp-step { min-width: 70px; }
  .rnfp-step-dot { width: 36px; height: 36px; font-size: 1rem; }
}

/* ── Master Panel ───────────────────────────────────────────────────────── */
.rnfpm-tabs { display:flex; gap:4px; margin-bottom:20px; border-bottom:2px solid #e2e8f0; }
.rnfpm-tab  { background:none; border:none; padding:10px 20px; font-size:14px; font-weight:500; color:#64748b; cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-2px; }
.rnfpm-tab.ativo { color:#1d4ed8; border-bottom-color:#1d4ed8; }
.rnfpm-tab:hover  { color:#1d4ed8; }

.rnfpm-btn-add     { background:#1d4ed8; color:#fff; border:none; padding:8px 16px; border-radius:8px; font-size:13px; font-weight:600; cursor:pointer; white-space:nowrap; }
.rnfpm-btn-add:hover { opacity:.88; }
.rnfpm-btn-primary { background:#1d4ed8; color:#fff; border:none; padding:10px 20px; border-radius:8px; font-size:14px; font-weight:600; cursor:pointer; }
.rnfpm-btn-primary:hover { opacity:.88; }
.rnfpm-btn-sm      { background:#f1f5f9; color:#374151; border:1px solid #e2e8f0; padding:4px 10px; border-radius:6px; font-size:12px; cursor:pointer; margin-right:4px; }
.rnfpm-btn-sm:hover { background:#e2e8f0; }

.rnfpm-table       { width:100%; border-collapse:collapse; font-size:13px; }
.rnfpm-table th    { text-align:left; padding:10px 12px; background:#f8fafc; border-bottom:1px solid #e2e8f0; font-weight:600; color:#64748b; font-size:12px; white-space:nowrap; }
.rnfpm-table td    { padding:10px 12px; border-bottom:1px solid #f1f5f9; vertical-align:middle; }
.rnfpm-table tr:hover td { background:#f8fafc; }

.rnfpm-badge       { display:inline-block; padding:3px 10px; border-radius:20px; font-size:11px; font-weight:600; }
.badge-col         { background:#fef3c7; color:#92400e; }
.badge-and         { background:#dbeafe; color:#1e40af; }
.badge-ent         { background:#dcfce7; color:#166534; }

.rnfpm-modal       { position:fixed; inset:0; background:rgba(0,0,0,.55); z-index:9999; display:flex; align-items:center; justify-content:center; }
.rnfpm-modal-box   { background:#fff; border-radius:14px; padding:28px 32px; max-width:480px; width:94%; box-shadow:0 8px 40px rgba(0,0,0,.18); max-height:90vh; overflow-y:auto; }
.rnfpm-modal-box h3{ margin:0 0 18px; font-size:16px; }
.rnfpm-input       { width:100%; padding:9px 12px; border:1px solid #e2e8f0; border-radius:8px; font-size:14px; box-sizing:border-box; }
.rnfpm-input:focus { outline:none; border-color:#1d4ed8; }
.rnfpm-modal-footer{ display:flex; justify-content:flex-end; gap:10px; margin-top:20px; }
.rnfpm-msg         { padding:10px 14px; border-radius:7px; font-size:13px; font-weight:500; margin-bottom:14px; }
.rnfpm-msg.success { background:#dcfce7; color:#166534; border:1px solid #bbf7d0; }
.rnfpm-msg.error   { background:#fee2e2; color:#991b1b; border:1px solid #fecaca; }

/* ── Paginação master ───────────────────────────────────────────────────── */
.rnfpm-paginacao   { display:flex; align-items:center; gap:6px; flex-wrap:wrap; padding:14px 0; }
.rnfpm-pag-info    { font-size:12px; color:#94a3b8; margin-right:8px; }
.rnfpm-pag-btn     { background:var(--color-background-primary,#fff); border:1px solid #e2e8f0; color:#374151; padding:5px 11px; border-radius:6px; font-size:13px; cursor:pointer; }
.rnfpm-pag-btn:hover:not(:disabled) { background:#eff6ff; border-color:#1d4ed8; color:#1d4ed8; }
.rnfpm-pag-btn.ativo  { background:#1d4ed8; color:#fff; border-color:#1d4ed8; font-weight:600; }
.rnfpm-pag-btn:disabled { opacity:.4; cursor:not-allowed; }
.rnfpm-pag-ellipsis { color:#94a3b8; padding:0 4px; }

/* Aviso canhoto obrigatório */
.rnfpm-canhoto-aviso { background:#fef3c7; border:1px solid #fde68a; color:#92400e; border-radius:7px; padding:10px 14px; font-size:13px; margin-bottom:12px; }

.rnfp-badge.cancelada, .rnfp-badge-grande.cancelada { background:#fee2e2; color:#991b1b; }
.rnfpm-badge.badge-can { background:#fee2e2; color:#991b1b; }
