/* =================================================================
   ReceiptAlert — Banner de alerta de recibos pendentes
   Precifika · v1.0
================================================================= */

/* ── Container principal (oculto por padrão) ── */
#ra-alert-bar {
  display: none;
  background: #fff;
  border: 1.5px solid #fbbf24;
  border-left: 5px solid #f59e0b;
  border-radius: 16px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.13), 0 1px 4px rgba(0,0,0,.06);
  overflow: hidden;
  animation: ra-slide-in .35s cubic-bezier(.22,.68,0,1.2) both;
}

@keyframes ra-slide-in {
  from { opacity: 0; transform: translateY(-12px) scaleY(.96); }
  to   { opacity: 1; transform: translateY(0)     scaleY(1); }
}

/* Fecha com fade+collapse */
#ra-alert-bar.ra--closing {
  animation: ra-slide-out .35s ease forwards;
}
@keyframes ra-slide-out {
  from { opacity: 1; max-height: 600px; }
  to   { opacity: 0; max-height: 0; padding: 0; margin: 0; }
}

/* ── Cabeçalho ── */
.ra-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px 12px;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-bottom: 1px solid #fde68a;
}

.ra-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.ra-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(245,158,11,.35);
}

.ra-header-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ra-title {
  font-size: 14px;
  font-weight: 700;
  color: #92400e;
  letter-spacing: -.1px;
  white-space: nowrap;
}

.ra-count {
  font-size: 16px;
  font-weight: 900;
  color: #d97706;
}

.ra-subtitle {
  font-size: 12px;
  color: #a16207;
  font-weight: 400;
}

.ra-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Botão "Dispensar todos" */
.ra-btn-all {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #92400e;
  background: rgba(245,158,11,.12);
  border: 1px solid rgba(245,158,11,.30);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}
.ra-btn-all:hover {
  background: rgba(245,158,11,.22);
  border-color: rgba(245,158,11,.55);
}

/* Botão fechar (×) */
.ra-close {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: #a16207;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: background .15s, color .15s;
}
.ra-close:hover {
  background: rgba(245,158,11,.15);
  color: #78350f;
}

/* ── Lista de orçamentos ── */
.ra-list {
  padding: 8px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 340px;
  overflow-y: auto;
}

/* Scrollbar fina */
.ra-list::-webkit-scrollbar        { width: 4px; }
.ra-list::-webkit-scrollbar-track  { background: transparent; }
.ra-list::-webkit-scrollbar-thumb  { background: #fcd34d; border-radius: 2px; }

/* ── Cada item de orçamento ── */
.ra-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: #fafaf9;
  border: 1px solid #fde68a;
  border-radius: 10px;
  transition: background .15s, transform .15s, opacity .3s;
  animation: ra-item-in .25s ease both;
}
.ra-item:hover { background: #fef9ee; }

@keyframes ra-item-in {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Animação de saída ao dispensar */
.ra-item--exit {
  opacity: 0 !important;
  transform: translateX(20px) !important;
  pointer-events: none;
}

.ra-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.ra-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(245,158,11,.12);
  color: #d97706;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.ra-item-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.ra-item-code {
  font-size: 11px;
  font-weight: 700;
  color: #d97706;
  letter-spacing: .3px;
  text-transform: uppercase;
}

.ra-item-project {
  font-size: 13px;
  font-weight: 600;
  color: #1c1917;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

.ra-item-meta {
  font-size: 11px;
  color: #78716c;
}

.ra-item-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.ra-item-age {
  font-size: 11px;
  color: #a16207;
  font-weight: 500;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ra-item-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Botão "Emitir recibo" */
.ra-btn--emit {
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: none;
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(245,158,11,.30);
  transition: box-shadow .15s, transform .1s, filter .15s;
}
.ra-btn--emit:hover {
  box-shadow: 0 4px 12px rgba(245,158,11,.45);
  transform: translateY(-1px);
  filter: brightness(1.05);
}
.ra-btn--emit:active { transform: translateY(0); }

/* Botão dispensar individual (sino) */
.ra-btn--dismiss {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid #fde68a;
  background: transparent;
  color: #a16207;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: background .15s, color .15s, border-color .15s;
  flex-shrink: 0;
}
.ra-btn--dismiss:hover {
  background: rgba(245,158,11,.12);
  border-color: #f59e0b;
  color: #78350f;
}

/* ── Responsivo ── */
@media (max-width: 768px) {
  .ra-header { padding: 12px 14px 10px; }
  .ra-title   { font-size: 13px; }
  .ra-btn-all { display: none; } /* No mobile: dispensar um a um */

  .ra-item {
    flex-wrap: wrap;
    gap: 8px;
  }
  .ra-item-right {
    width: 100%;
    justify-content: flex-end;
  }
  .ra-item-age { display: none; }
  .ra-item-project { max-width: 200px; }
}

@media (max-width: 480px) {
  .ra-list { padding: 6px 8px 8px; }
  .ra-item { padding: 8px 10px; }
  .ra-btn--emit { font-size: 11px; padding: 5px 9px; }
}
