/* ═══════════════════════════════════════
   RS COMPONENTS — botões, cards, inputs, badges
   ═══════════════════════════════════════ */

/* ── Reset base ── */
.rs-sistema * { box-sizing: border-box; }
.rs-sistema { font-family: var(--font-body); color: var(--text); background: var(--bg); }

/* ── Botões ── */
.rs-btn-primary {
  background: var(--red);
  color: #fff;
  padding: 10px 22px;
  border-radius: 8px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.85rem;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: background 0.25s, transform 0.25s, box-shadow 0.25s;
}
.rs-btn-primary:hover {
  background: var(--red-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--red-glow);
  color: #fff;
}
.rs-btn-primary:active { transform: translateY(0); }

.rs-btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.rs-btn-ghost:hover { border-color: var(--red); color: var(--red); }

.rs-btn-danger {
  background: transparent;
  color: #ef4444;
  border: 1px solid rgba(239,68,68,0.3);
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
.rs-btn-danger:hover { background: rgba(239,68,68,0.1); }

/* ── Cards ── */
.rs-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}
.rs-card:hover {
  border-color: rgba(221,51,51,0.3);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

/* ── Inputs ── */
.rs-input,
.rs-select,
.rs-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 16px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  appearance: none;
}
.rs-input:focus,
.rs-select:focus,
.rs-textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-light);
}
.rs-input::placeholder,
.rs-textarea::placeholder { color: var(--text-muted); }
.rs-textarea { resize: vertical; min-height: 100px; }
.rs-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239CA3AF' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

.rs-field { margin-bottom: 20px; }
.rs-field label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.rs-field .rs-error { color: #ef4444; font-size: 0.78rem; margin-top: 4px; }

/* ── Badges ── */
.rs-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.rs-badge-active   { background: rgba(34,197,94,0.12);  color: #22c55e; }
.rs-badge-pending  { background: rgba(234,179,8,0.12);  color: #eab308; }
.rs-badge-rejected { background: rgba(239,68,68,0.12);  color: #ef4444; }
.rs-badge-approved { background: rgba(59,130,246,0.12); color: #3b82f6; }
.rs-badge-closed   { background: rgba(107,114,128,0.12);color: #6b7280; }
.rs-badge-urgente  { background: rgba(239,68,68,0.15);  color: #ef4444; }

/* ── Section tag / títulos ── */
.rs-section-tag {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-family: var(--font-head);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 20px;
}
.rs-section-title {
  font-family: var(--font-head);
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 900;
  line-height: 1.1;
  color: var(--text-strong);
  margin-bottom: 16px;
}
.rs-section-title span { color: var(--red); }
.rs-section-sub {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Animações ── */
.rs-animate {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.rs-animate.visible { opacity: 1; transform: translateY(0); }
.rs-delay-1 { transition-delay: 0.1s; }
.rs-delay-2 { transition-delay: 0.2s; }
.rs-delay-3 { transition-delay: 0.3s; }
.rs-delay-4 { transition-delay: 0.4s; }

/* ── Grid helpers ── */
.rs-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.rs-grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
@media (max-width: 768px) {
  .rs-grid-2, .rs-grid-3 { grid-template-columns: 1fr; }
}

/* ── Divisor ── */
.rs-divider { border: none; border-top: 1px solid var(--border); margin: 32px 0; }

/* ── Loading spinner ── */
.rs-spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: rs-spin 0.8s linear infinite;
  margin: 32px auto;
}
@keyframes rs-spin { to { transform: rotate(360deg); } }

/* ── Empty state ── */
.rs-empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
}
.rs-empty-state p { font-size: 1rem; }

/* ── Toast notification ── */
#rs-toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--red);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 0.9rem;
  color: var(--text);
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  transform: translateX(200%);
  transition: transform 0.3s ease;
  max-width: 360px;
}
#rs-toast.visible { transform: translateX(0); }
#rs-toast.rs-toast-success { border-left-color: #22c55e; }
#rs-toast.rs-toast-error   { border-left-color: #ef4444; }

/* ── Tabs ── */
.rs-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 32px; }
.rs-tab {
  padding: 10px 20px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.rs-tab:hover { color: var(--text); }
.rs-tab.active { color: var(--red); border-bottom-color: var(--red); }
.rs-tab-panel { display: none; }
.rs-tab-panel.active { display: block; }

/* ── Modal overlay ── */
.rs-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.rs-modal-overlay.open { opacity: 1; pointer-events: all; }
.rs-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 560px;
  transform: scale(0.95);
  transition: transform 0.3s;
  position: relative;
}
.rs-modal-overlay.open .rs-modal { transform: scale(1); }
.rs-modal-close {
  position: absolute; top: 16px; right: 20px;
  background: none; border: none;
  font-size: 1.4rem; color: var(--text-muted);
  cursor: pointer; line-height: 1;
}
.rs-modal-title {
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-strong);
  margin: 0 0 24px;
}

/* ── Scrollbar ── */
.rs-sistema ::-webkit-scrollbar { width: 6px; height: 6px; }
.rs-sistema ::-webkit-scrollbar-track { background: var(--scrollbar-bg); }
.rs-sistema ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.rs-sistema ::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
