﻿/* =====================================================
   RETIRO+ - Design System v2.0
   BureiTech | Mobile First | Light Mode
   ===================================================== */

/* Google Fonts - Poppins */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* ===== Design Tokens ===== */
:root {
  /* Brand */
  --rp-primary:       #F5C542;
  --rp-primary-dark:  #E0B932;
  --rp-primary-light: #FFD95A;
  --rp-primary-bg:    rgba(245, 197, 66, 0.12);
  --rp-navy:          #1e3a5f;
  --rp-navy-dark:     #0d2137;

  /* Text */
  --rp-text-900: #1F2937;
  --rp-text-700: #374151;
  --rp-text-400: #6B7280;
  --rp-text-muted: #9CA3AF;

  /* Backgrounds */
  --rp-bg-page:   #F8F9FB;
  --rp-bg-white:  #FFFFFF;
  --rp-bg-subtle: #F3F4F6;

  /* Borders */
  --rp-border: #E5E7EB;

  /* Status */
  --rp-success: #3DDC84;
  --rp-error:   #FF5C5C;
  --rp-warning: #F59E0B;
  --rp-info:    #3B82F6;

  /* Radius */
  --rp-radius-sm: 10px;
  --rp-radius:    16px;
  --rp-radius-lg: 20px;

  /* Shadows */
  --rp-shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --rp-shadow-sm: 0 1px 4px rgba(0,0,0,0.06), 0 2px 6px rgba(0,0,0,0.04);
  --rp-shadow:    0 4px 16px rgba(0,0,0,0.08);
  --rp-shadow-md: 0 8px 24px rgba(0,0,0,0.10);
  --rp-shadow-lg: 0 16px 40px rgba(0,0,0,0.14);

  /* Layout */
  --rp-topbar-h:    60px;
  --rp-sidebar-w:   240px;
  --rp-bottomnav-h: 68px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--rp-bg-page);
  color: var(--rp-text-900);
  font-size: 0.9375rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  color: var(--rp-text-900);
  line-height: 1.3;
}

a { color: var(--rp-navy); }

/* ===== TOP BAR ===== */
.rp-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--rp-topbar-h);
  background: var(--rp-bg-white);
  border-bottom: 1px solid var(--rp-border);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  gap: 0.75rem;
  z-index: 1030;
  box-shadow: var(--rp-shadow-sm);
}

.rp-topbar-logo img  { height: 34px; width: auto; }
.rp-topbar-logo-dark { background: var(--rp-navy); border-radius: 8px; padding: 4px 10px; display: inline-flex; }

.rp-topbar-title {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--rp-text-700);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rp-menu-btn {
  background: none;
  border: none;
  color: var(--rp-text-400);
  font-size: 1.3rem;
  line-height: 1;
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.rp-menu-btn:hover { background: var(--rp-bg-subtle); color: var(--rp-text-900); }

.rp-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--rp-navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: box-shadow 0.2s, transform 0.1s;
  flex-shrink: 0;
}
.rp-avatar:hover, .rp-avatar:focus {
  box-shadow: 0 0 0 3px rgba(245, 197, 66, 0.35);
  transform: scale(1.05);
}

/* ===== SIDEBAR ===== */
.rp-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 1025;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.rp-overlay.open { display: block; }

.rp-sidebar {
  position: fixed;
  top: var(--rp-topbar-h);
  left: 0;
  bottom: 0;
  width: var(--rp-sidebar-w);
  background: var(--rp-bg-white);
  border-right: 1px solid var(--rp-border);
  overflow-y: auto;
  padding: 1rem 0 2rem;
  z-index: 1026;
  transition: transform 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@media (max-width: 991.98px) {
  .rp-sidebar {
    transform: translateX(-100%);
    box-shadow: var(--rp-shadow-lg);
    width: min(var(--rp-sidebar-w), 80vw);
  }
  .rp-sidebar.open { transform: translateX(0); }
}

.rp-sidebar-section {
  padding: 0.75rem 1.25rem 0.25rem;
}
.rp-sidebar-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--rp-text-muted);
}

.rp-sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.25rem;
  color: var(--rp-text-700);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  border-left: 3px solid transparent;
  position: relative;
}
.rp-sidebar-link i { font-size: 1rem; width: 18px; flex-shrink: 0; opacity: 0.75; }
.rp-sidebar-link:hover  { background: var(--rp-bg-subtle); color: var(--rp-text-900); border-left-color: var(--rp-border); }
.rp-sidebar-link:hover i { opacity: 1; }
.rp-sidebar-link.active {
  background: var(--rp-primary-bg);
  color: #6b4c00;
  border-left-color: var(--rp-primary);
  font-weight: 600;
}
.rp-sidebar-link.active i { opacity: 1; color: #b07d00; }
.rp-sidebar-link.danger { color: var(--rp-error); }
.rp-sidebar-link.danger i { opacity: 0.8; }
.rp-sidebar-link.danger:hover { background: rgba(255, 92, 92, 0.06); color: var(--rp-error); }

/* ===== MAIN CONTENT ===== */
.rp-main {
  padding-top: calc(var(--rp-topbar-h) + 1.25rem);
  padding-left: 1.25rem;
  padding-right: 1.25rem;
  padding-bottom: calc(var(--rp-bottomnav-h) + 1.25rem);
  min-height: 100vh;
}
@media (min-width: 992px) {
  .rp-main {
    margin-left: var(--rp-sidebar-w);
    padding-bottom: 2rem;
  }
}
@media (max-width: 575.98px) {
  .rp-main { padding-left: 0.875rem; padding-right: 0.875rem; }
}

/* ===== BOTTOM NAVIGATION ===== */
.rp-bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--rp-bottomnav-h);
  background: var(--rp-bg-white);
  border-top: 1px solid var(--rp-border);
  display: flex;
  z-index: 1030;
  box-shadow: 0 -2px 16px rgba(0,0,0,0.06);
}
@media (min-width: 992px) {
  .rp-bottom-nav { display: none; }
}

.rp-bnav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--rp-text-muted);
  font-size: 0.63rem;
  font-weight: 500;
  padding: 8px 4px 10px;
  transition: color 0.2s;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  border: none;
  background: none;
}
.rp-bnav-item i    { font-size: 1.3rem; transition: transform 0.2s; }
.rp-bnav-item.active { color: #b07d00; }
.rp-bnav-item.active i { transform: scale(1.1); color: #E0B932; }
.rp-bnav-item.active::before {
  content: '';
  position: absolute;
  top: 0; left: 15%; right: 15%;
  height: 3px;
  background: var(--rp-primary);
  border-radius: 0 0 4px 4px;
}
.rp-bnav-item:active i { transform: scale(0.88); }

/* ===== PAGE HEADER ===== */
.rp-page-header { margin-bottom: 1.25rem; }
.rp-page-header h4, .rp-page-header h5 { font-size: 1.125rem; font-weight: 700; margin-bottom: 0.2rem; }
.rp-page-header .text-muted { font-size: 0.8rem; }

/* ===== CARDS ===== */
.card {
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius);
  box-shadow: var(--rp-shadow-sm);
  background: var(--rp-bg-white);
  transition: box-shadow 0.2s;
}
.card:hover { box-shadow: var(--rp-shadow); }
.card-header {
  background: var(--rp-bg-white);
  border-bottom: 1px solid var(--rp-border);
  border-radius: var(--rp-radius) var(--rp-radius) 0 0 !important;
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--rp-text-700);
}
.card-body   { padding: 1.25rem; }
.card-footer { padding: 0.875rem 1.25rem; background: var(--rp-bg-subtle); border-top: 1px solid var(--rp-border); border-radius: 0 0 var(--rp-radius) var(--rp-radius) !important; }

/* Stat Cards */
.rp-stat {
  border-radius: var(--rp-radius);
  padding: 1.125rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  border: none;
  box-shadow: var(--rp-shadow-sm);
}
.rp-stat-icon  { font-size: 1.6rem; margin-bottom: 0.25rem; opacity: 0.9; }
.rp-stat-value { font-size: 1.85rem; font-weight: 700; line-height: 1; }
.rp-stat-label { font-size: 0.77rem; font-weight: 500; opacity: 0.75; }

.rp-stat-primary  { background: var(--rp-primary);      color: #3d2800; }
.rp-stat-navy     { background: var(--rp-navy);          color: #fff; }
.rp-stat-success  { background: var(--rp-success);       color: #0d3320; }
.rp-stat-blue     { background: var(--rp-info);          color: #fff; }
.rp-stat-purple   { background: #8B5CF6;                 color: #fff; }
.rp-stat-orange   { background: #F97316;                 color: #fff; }
.rp-stat-subtle   { background: var(--rp-bg-white);      color: var(--rp-text-900); border: 1px solid var(--rp-border); }

/* Quick Action Cards */
.rp-quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 1.125rem 0.5rem;
  background: var(--rp-bg-white);
  border: 1.5px solid var(--rp-border);
  border-radius: var(--rp-radius);
  text-decoration: none;
  color: var(--rp-text-900);
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  box-shadow: var(--rp-shadow-xs);
}
.rp-quick-action i    { font-size: 1.5rem; color: var(--rp-navy); }
.rp-quick-action span { line-height: 1.3; }
.rp-quick-action:hover, .rp-quick-action:active {
  background: var(--rp-primary-bg);
  border-color: var(--rp-primary);
  color: var(--rp-text-900);
  transform: translateY(-2px);
  box-shadow: var(--rp-shadow);
}
.rp-quick-action:hover i { color: #b07d00; }

/* ===== BUTTONS ===== */
.btn {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  border-radius: var(--rp-radius-sm);
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary {
  background: var(--rp-primary);
  border-color: var(--rp-primary);
  color: #3d2800;
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--rp-primary-dark);
  border-color: var(--rp-primary-dark);
  color: #3d2800;
  box-shadow: 0 4px 12px rgba(245,197,66,0.35);
}
.btn-outline-primary { border-color: var(--rp-primary); color: #7a5200; }
.btn-outline-primary:hover {
  background: var(--rp-primary);
  border-color: var(--rp-primary);
  color: #3d2800;
}
.btn-lg  { padding: 0.75rem 1.5rem; font-size: 1rem; border-radius: var(--rp-radius); min-height: 52px; }
.btn-sm  { font-size: 0.8rem; padding: 0.35rem 0.75rem; }
.btn-icon { width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }

/* ===== FORMS ===== */
.form-control, .form-select {
  font-family: 'Poppins', sans-serif;
  border-color: var(--rp-border);
  border-radius: var(--rp-radius-sm);
  padding: 0.7rem 1rem;
  font-size: 0.9375rem;
  color: var(--rp-text-900);
  background-color: var(--rp-bg-white);
  transition: border-color 0.2s, box-shadow 0.2s;
  min-height: 48px;
}
.form-control:focus, .form-select:focus {
  border-color: var(--rp-primary);
  box-shadow: 0 0 0 3px rgba(245, 197, 66, 0.22);
  outline: none;
}
.form-control::placeholder { color: var(--rp-text-muted); }
.form-label {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--rp-text-700);
  margin-bottom: 0.3rem;
}
.input-group-text {
  background: var(--rp-bg-subtle);
  border-color: var(--rp-border);
  color: var(--rp-text-400);
  min-height: 48px;
}

/* ===== TABLES ===== */
.table { font-size: 0.875rem; }
.table th {
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--rp-text-400);
  border-bottom: 2px solid var(--rp-border) !important;
  white-space: nowrap;
  padding: 0.75rem;
}
.table td {
  padding: 0.85rem 0.75rem;
  vertical-align: middle;
  color: var(--rp-text-700);
  border-bottom: 1px solid var(--rp-border);
}
.table > tbody > tr:hover > td { background: var(--rp-bg-subtle); }
.table-responsive { border-radius: var(--rp-radius); overflow: hidden; }

/* ===== BADGES ===== */
.badge {
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  border-radius: 6px;
  font-size: 0.72rem;
  padding: 0.28em 0.65em;
  letter-spacing: 0.01em;
}

/* ===== ALERTS ===== */
.alert {
  border-radius: var(--rp-radius-sm);
  border: none;
  font-size: 0.875rem;
  padding: 0.9rem 1.1rem;
}
.alert-warning { background: rgba(245,158,11,0.1);  color: #92400e; }
.alert-success { background: rgba(61,220,132,0.1);  color: #14532d; }
.alert-danger  { background: rgba(255,92,92,0.1);   color: #991b1b; }
.alert-info    { background: rgba(59,130,246,0.1);  color: #1e3a8a; }
.alert-primary { background: var(--rp-primary-bg);  color: #6b4c00; }

/* ===== FLASH MESSAGES ===== */
.rp-flash {
  animation: rpSlideDown 0.3s ease;
}
@keyframes rpSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== LIST ITEMS ===== */
.rp-list-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--rp-border);
}
.rp-list-item:last-child { border-bottom: none; }
.rp-list-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--rp-bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--rp-text-400);
  flex-shrink: 0;
}

/* ===== RETIRO INFO CARD ===== */
.rp-retiro-hero {
  background: linear-gradient(135deg, var(--rp-navy) 0%, #2d5282 100%);
  border-radius: var(--rp-radius-lg);
  padding: 1.5rem;
  color: #fff;
  position: relative;
  overflow: hidden;
  border: none;
  box-shadow: var(--rp-shadow-md);
}
.rp-retiro-hero::after {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 140px; height: 140px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}
.rp-retiro-hero .badge-ativo {
  background: var(--rp-success);
  color: #0d3320;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.3em 0.75em;
  border-radius: 20px;
}

/* ===== DROPDOWN ===== */
.dropdown-menu {
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-sm);
  box-shadow: var(--rp-shadow-md);
  font-family: 'Poppins', sans-serif;
  font-size: 0.875rem;
  padding: 0.35rem 0;
}
.dropdown-item { padding: 0.6rem 1rem; color: var(--rp-text-700); font-weight: 500; }
.dropdown-item:hover { background: var(--rp-bg-subtle); color: var(--rp-text-900); }
.dropdown-item.text-danger { color: var(--rp-error) !important; }
.dropdown-divider { border-color: var(--rp-border); }

/* ===== MODAL ===== */
.modal-content {
  border: none;
  border-radius: var(--rp-radius-lg);
  box-shadow: var(--rp-shadow-lg);
}
.modal-header { border-bottom: 1px solid var(--rp-border); padding: 1.25rem 1.5rem; }
.modal-body   { padding: 1.5rem; }
.modal-footer { border-top: 1px solid var(--rp-border); padding: 1rem 1.5rem; }

/* ===== PRINT ===== */
@media print {
  .rp-topbar, .rp-sidebar, .rp-bottom-nav, .rp-overlay { display: none !important; }
  .rp-main { margin-left: 0 !important; padding: 0.5rem !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; break-inside: avoid; }
  .btn, form .btn { display: none !important; }
  body { font-size: 11pt; }
  .table { font-size: 10pt; }
  .bg-success, .bg-danger, .bg-warning, .bg-info, .bg-primary {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--rp-bg-subtle); }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--rp-text-muted); }

/* ===== UTILITIES ===== */
.fw-medium  { font-weight: 500; }
.text-xs    { font-size: 0.75rem; }
.text-sm    { font-size: 0.8125rem; }
.lh-tight   { line-height: 1.3; }
.rounded-xl { border-radius: var(--rp-radius); }
.rounded-2xl{ border-radius: var(--rp-radius-lg); }

/* ===== RADIO/CHECKBOX CUSTOM ===== */
.btn-check:checked + .btn-outline-success {
  background-color: #3DDC84; border-color: #3DDC84; color: #0d3320;
}
.btn-check:checked + .btn-outline-danger {
  background-color: #FF5C5C; border-color: #FF5C5C; color: #fff;
}

/* ===== HOVER CARDS RELATÓRIO ===== */
.row a.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--rp-shadow-md) !important;
}
