/* === RESET === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 14px; }
body { font-family: 'Inter', -apple-system, sans-serif; background: #F8F9FA; color: #333; line-height: 1.55; min-height: 100vh; -webkit-font-smoothing: antialiased; }

/* === LAYOUT === */
.app-container { display: flex; min-height: 100vh; }
.main-content { flex: 1; margin-left: 220px; display: flex; flex-direction: column; }
.page-content { padding: 2rem 2.5rem; flex: 1; max-width: 1320px; }

/* === SIDEBAR === */
.sidebar { width: 220px; background: #0C2D48; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; display: flex; flex-direction: column; }
.sidebar-brand { padding: 1.4rem 1.25rem 1.2rem; border-bottom: 1px solid rgba(196,149,106,0.15); }
.brand-logo { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.brand-icon-svg { flex-shrink: 0; }
.brand-text-group { display: flex; flex-direction: column; }
.brand-text { font-size: 16px; font-weight: 300; color: #fff; line-height: 1.1; letter-spacing: 0.15em; }
.brand-sub { font-size: 8.5px; font-weight: 300; color: rgba(255,255,255,0.5); letter-spacing: 0.28em; text-transform: uppercase; margin-top: 1px; }

.sidebar-nav { flex: 1; padding: 0.6rem 0; overflow-y: auto; }
.nav-section { padding: 1.4rem 1.25rem 0.35rem; font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(255,255,255,0.25); }
.nav-item { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 1.25rem; color: rgba(255,255,255,0.55); text-decoration: none; font-size: 13px; font-weight: 450; transition: all 0.1s; }
.nav-item svg { opacity: 0.5; transition: opacity 0.1s; }
.nav-item:hover { color: rgba(255,255,255,0.9); }
.nav-item:hover svg { opacity: 0.8; }
.nav-item.active { color: #fff; background: rgba(255,255,255,0.08); }
.nav-item.active svg { opacity: 1; }

.nav-item-pagar { margin: 0.6rem 0.75rem; padding: 0.5rem 1rem; background: #C9A84C; color: #fff !important; border-radius: 6px; font-weight: 600; justify-content: center; letter-spacing: 0.3px; font-size: 12px; }
.nav-item-pagar svg { opacity: 1 !important; }
.nav-item-pagar:hover { background: #b89a42 !important; }
.nav-item-pagar.active { background: #C9A84C; }

.sidebar-footer { border-top: 1px solid rgba(255,255,255,0.07); padding: 0.4rem 0; }

/* === HEADER === */
.top-header { background: #fff; padding: 0.85rem 2.5rem; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #ECEEF1; position: sticky; top: 0; z-index: 50; }
.page-title { font-size: 16px; font-weight: 600; color: #1B2B4B; }
.search-bar { display: flex; align-items: center; gap: 0.45rem; background: #F8F9FA; border: 1px solid #ECEEF1; border-radius: 6px; padding: 0.38rem 0.75rem; flex: 1; max-width: 400px; margin: 0 2rem; }
.search-bar input { border: none; background: transparent; flex: 1; font-size: 13px; outline: none; color: #333; }
.search-bar input::placeholder { color: #B0B0B0; }
.search-bar svg { color: #B0B0B0; flex-shrink: 0; }
.user-info { display: flex; align-items: center; gap: 0.6rem; }
.user-avatar { width: 30px; height: 30px; border-radius: 50%; background: #1B2B4B; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 11px; color: #fff; }
.user-details { display: flex; flex-direction: column; }
.user-name { font-weight: 500; font-size: 13px; color: #333; }
.user-role { font-size: 11px; color: #999; }

/* === CARDS === */
.card { background: #fff; border-radius: 8px; border: 1px solid #ECEEF1; margin-bottom: 1.5rem; }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 0.9rem 1.25rem; border-bottom: 1px solid #F3F4F6; }
.card-header h2 { font-size: 14px; font-weight: 600; color: #1B2B4B; }
.card-body { padding: 1.25rem; }

/* === STAT CARDS === */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.85rem; margin-bottom: 1.5rem; }
.stat-card { background: #fff; border-radius: 8px; padding: 1rem 1.15rem; border: 1px solid #ECEEF1; }
.stat-number { font-size: 24px; font-weight: 700; color: #1B2B4B; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 11px; color: #999; margin-top: 0.15rem; font-weight: 450; letter-spacing: 0.02em; }

/* === CHARTS === */
.charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
.chart-container { padding: 1.25rem; }
.chart-container h3 { font-size: 13px; font-weight: 600; color: #1B2B4B; margin-bottom: 1rem; }
.chart-bar-group { display: flex; flex-direction: column; gap: 0.5rem; }
.chart-bar-item { display: flex; align-items: center; gap: 0.6rem; }
.chart-bar-label { font-size: 11px; color: #888; min-width: 100px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-bar-track { flex: 1; height: 6px; background: #F3F4F6; border-radius: 3px; overflow: hidden; }
.chart-bar-fill { height: 100%; border-radius: 3px; background: #1B2B4B; transition: width 0.4s; min-width: 2px; }
.chart-bar-value { font-size: 11px; font-weight: 600; color: #555; min-width: 60px; font-variant-numeric: tabular-nums; }
.chart-month-bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding-top: 0.5rem; }
.chart-month-col { display: flex; flex-direction: column; align-items: center; flex: 1; height: 100%; justify-content: flex-end; }
.chart-month-bar { width: 100%; max-width: 32px; border-radius: 3px 3px 0 0; background: #C9A84C; transition: height 0.4s; min-height: 2px; }
.chart-month-label { font-size: 10px; color: #999; margin-top: 0.35rem; }

/* === TABLE === */
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th { padding: 0.6rem 1rem; text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: #999; font-weight: 500; border-bottom: 1px solid #ECEEF1; }
tbody td { padding: 0.6rem 1rem; border-bottom: 1px solid #F7F7F7; font-size: 13px; color: #333; }
tbody tr:hover { background: #FAFBFC; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: #BBB; }
.actions-cell { display: flex; gap: 0.3rem; align-items: center; flex-wrap: wrap; }

/* === STATUS DOTS === */
.status-dot { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 12px; font-weight: 450; color: #666; }
.status-dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.status-dot.dot-solicitado::before { background: #E6A817; }
.status-dot.dot-aguardando::before { background: #EA4335; }
.status-dot.dot-pendente::before { background: #E6A817; }
.status-dot.dot-pago::before { background: #34A853; }
.status-dot.dot-vencido::before { background: #EA4335; }
.status-dot.dot-cancelado::before { background: #999; }

/* Flow buttons */
.btn-flow { padding: 0.25rem 0.55rem; font-size: 11px; font-weight: 600; border-radius: 4px; cursor: pointer; border: none; }
.btn-flow-solicitado { background: #FFF3E0; color: #E65100; }
.btn-flow-solicitado:hover { background: #FFE0B2; }
.btn-flow-aguardando { background: #FFEBEE; color: #C62828; }
.btn-flow-pagar { background: #E8F5E9; color: #2E7D32; }
.btn-flow-pagar:hover { background: #C8E6C9; }

/* Flow modal steps */
.flow-step { text-align: center; padding: 1rem 0; }
.flow-step p { font-size: 14px; color: #333; margin-bottom: 1rem; font-weight: 500; }
.flow-step .flow-btns { display: flex; gap: 0.75rem; justify-content: center; }
.flow-step .flow-btns .btn { min-width: 80px; }

/* === BADGES (minimal) === */
.badge { display: inline-block; padding: 0.12rem 0.5rem; border-radius: 4px; font-size: 11px; font-weight: 500; }
.badge-boleto { background: #F3F4F6; color: #555; }
.badge-pix { background: #F3F4F6; color: #555; }
.badge-ativo { color: #34A853; font-weight: 500; font-size: 12px; }
.badge-inativo { color: #999; font-weight: 500; font-size: 12px; }
.badge-perfil-admin { background: #F3F4F6; color: #1B2B4B; }
.badge-perfil-solicitante { background: #F3F4F6; color: #555; }
.badge-perfil-visualizador { background: #F3F4F6; color: #555; }
.badge-lg { font-size: 12px; padding: 0.15rem 0.6rem; }
.badge-pendente { background: none; }
.badge-pago { background: none; }
.badge-vencido { background: none; }

/* === BUTTONS === */
.btn { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.42rem 0.85rem; border: none; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; text-decoration: none; transition: all 0.1s; }
.btn-primary { background: #1B2B4B; color: #fff; }
.btn-primary:hover { background: #152340; }
.btn-gold { background: #C9A84C; color: #fff; }
.btn-gold:hover { background: #b89a42; }
.btn-outline { background: transparent; border: 1px solid #DDD; color: #666; }
.btn-outline:hover { background: #F8F9FA; border-color: #BBB; }
.btn-danger { background: none; color: #EA4335; border: 1px solid #FADAD6; }
.btn-danger:hover { background: #FEF2F0; }
.btn-success { background: none; color: #34A853; border: 1px solid #C8E6C9; }
.btn-success:hover { background: #F0FAF0; }
.btn-link { background: none; border: none; color: #C9A84C; padding: 0; font-weight: 500; font-size: 13px; }
.btn-link:hover { opacity: 0.7; }
.btn-sm { padding: 0.25rem 0.5rem; font-size: 11px; }
.btn-block { width: 100%; justify-content: center; }

/* === FORMS === */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: #555; margin-bottom: 0.25rem; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 0.5rem 0.7rem; border: 1px solid #DDD; border-radius: 6px; font-size: 13px; font-family: 'Inter', sans-serif; transition: border-color 0.1s; background: #fff; color: #333; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: #1B2B4B; box-shadow: 0 0 0 2px rgba(27,43,75,0.06); }
.input-readonly { background: #F8F9FA !important; color: #999 !important; cursor: default; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-section { margin-bottom: 1.75rem; padding-bottom: 1.5rem; border-bottom: 1px solid #F3F4F6; }
.form-section:last-of-type { border-bottom: none; }
.section-title { font-size: 11px; font-weight: 500; color: #999; margin-bottom: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; }
.form-actions { display: flex; gap: 0.6rem; justify-content: flex-end; padding-top: 0.75rem; }

/* === TOGGLE BUTTONS === */
.btn-group-toggle { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.btn-group-4 .btn-toggle { flex: 1; min-width: 115px; }
.btn-toggle { display: inline-flex; align-items: center; justify-content: center; padding: 0.42rem 0.75rem; border: 1px solid #DDD; border-radius: 6px; cursor: pointer; font-size: 12.5px; font-weight: 450; transition: all 0.1s; color: #888; background: #fff; flex: 1; }
.btn-toggle:hover { border-color: #999; color: #555; }
.btn-toggle input { display: none; }
.btn-toggle:has(input:checked) { border-color: #1B2B4B; background: #1B2B4B; color: #fff; font-weight: 500; }

/* === AUTOCOMPLETE === */
.autocomplete-wrapper { position: relative; }
.autocomplete-results { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid #DDD; border-radius: 6px; max-height: 200px; overflow-y: auto; z-index: 200; display: none; box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.autocomplete-results.show { display: block; }
.autocomplete-item { padding: 0.45rem 0.7rem; cursor: pointer; font-size: 13px; border-bottom: 1px solid #F7F7F7; }
.autocomplete-item:hover { background: #F8F9FA; }
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item .item-sub { font-size: 11px; color: #BBB; }
.autocomplete-item .item-incomplete { color: #EA4335; font-size: 11px; }

/* === MODAL === */
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.3); }
.modal-content { position: relative; background: #fff; border-radius: 10px; width: 90%; max-width: 460px; box-shadow: 0 16px 48px rgba(0,0,0,0.12); animation: modalIn 0.12s; }
@keyframes modalIn { from { opacity: 0; transform: translateY(6px); } }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid #F3F4F6; }
.modal-header h3 { font-size: 15px; font-weight: 600; color: #1B2B4B; }
.modal-close { background: none; border: none; font-size: 18px; cursor: pointer; color: #BBB; padding: 0; line-height: 1; }
.modal-close:hover { color: #666; }
.modal-body { padding: 1.25rem; }
.modal-footer { display: flex; gap: 0.6rem; justify-content: flex-end; padding: 0.85rem 1.25rem; border-top: 1px solid #F3F4F6; }

/* === ALERTS === */
.alert { padding: 0.6rem 0.85rem; border-radius: 6px; font-size: 13px; margin-bottom: 1rem; font-weight: 450; }
.alert-error { background: #FEF2F0; color: #D32F2F; }
.alert-success { background: #F0FAF0; color: #2E7D32; }
.alert-warning { background: #FFF8E7; color: #B8860B; }

/* === DETAILS === */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.detail-section { margin-bottom: 0.5rem; }
.detail-section .section-title { font-size: 11px; font-weight: 500; color: #999; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.6rem; }
.detail-row { display: flex; justify-content: space-between; padding: 0.45rem 0; border-bottom: 1px solid #F7F7F7; }
.detail-label { font-size: 12px; color: #999; font-weight: 450; }
.detail-value { font-size: 13px; font-weight: 500; text-align: right; color: #333; }
.detail-value-lg { font-size: 20px; font-weight: 700; color: #1B2B4B; }
.code-text { font-family: 'SF Mono', 'Consolas', monospace; font-size: 12px; word-break: break-all; color: #666; }

/* === LOGIN === */
.login-page { display: flex; align-items: center; justify-content: center; background: #F8F9FA; min-height: 100vh; }
.login-container { width: 100%; max-width: 360px; padding: 2rem; }
.login-card { background: #fff; border-radius: 10px; padding: 2.5rem 2rem; border: 1px solid #ECEEF1; }
.login-header { text-align: center; margin-bottom: 2rem; }
.login-brand { font-size: 22px; font-weight: 700; color: #1B2B4B; }
.login-brand-sub { font-size: 10px; text-transform: uppercase; letter-spacing: 0.25em; color: #BBB; margin-top: 2px; }
.login-header p { color: #999; font-size: 13px; margin-top: 1.25rem; }
.login-form .form-group { margin-bottom: 1.1rem; }
.login-form .btn { padding: 0.6rem; font-size: 13px; margin-top: 0.4rem; }
.login-footer-text { text-align: center; color: #CCC; font-size: 11px; margin-top: 1.5rem; }

/* === UTILITIES === */
.hidden { display: none !important; }
.conditional-field { animation: fadeIn 0.12s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-3px); } }
.filter-row { display: flex; gap: 0.75rem; align-items: end; flex-wrap: wrap; }
.filter-row .form-group { flex: 1; min-width: 130px; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .sidebar { width: 52px; }
  .brand-text-group, .nav-item span, .nav-section { display: none; }
  .sidebar-brand { padding: 1rem 0; justify-content: center; }
  .brand-logo { justify-content: center; }
  .nav-item { justify-content: center; padding: 0.65rem; }
  .nav-item-pagar { margin: 0.4rem 0.35rem; padding: 0.5rem 0; }
  .main-content { margin-left: 52px; }
  .page-content { padding: 1rem; }
  .top-header { padding: 0.85rem 1rem; }
  .form-row { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .charts-row { grid-template-columns: 1fr; }
  .search-bar { display: none; }
}
