﻿/* COMPONENTES SIDEBAR */
.sidebar-header {
    min-height: 94px;
    padding: 18px;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.96), rgba(14, 165, 233, 0.92)),
        var(--accent);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    box-sizing: border-box;
    box-shadow: inset 0 -1px 0 rgba(255,255,255,.16);
}

.brand-lockup { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 auto; }
.brand-mark { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.16); border: 1px solid rgba(255,255,255,0.26); font-size: 1.35rem; box-shadow: inset 0 1px 0 rgba(255,255,255,.18); }
.brand-lockup > div:last-child { min-width: 0; }
.sidebar-header h1 { margin:0 0 4px; font-size: 1.34rem; line-height: 1.05; font-weight: 850; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-header p { margin:0; opacity: 0.92; font-size: 0.78rem; line-height: 1.2; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav-menu { padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; flex: 1; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
.nav-section-label { padding: 12px 10px 4px; font-size: 0.61rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-tertiary); }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; min-height: 40px; background: transparent; border: 1px solid transparent; border-radius: 12px; font-size: 0.79rem; font-weight: 700; color: var(--text-secondary); cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease, color .18s ease; text-align: left; width: 100%; position: relative; }
.nav-item:hover { background: linear-gradient(180deg, #ffffff, #f8fafc); color: var(--text-primary); border-color: #dbe3ee; transform: translateX(2px); box-shadow: 0 12px 24px -24px rgba(15, 23, 42, .55), inset 0 1px 0 rgba(255, 255, 255, .82); }
.nav-item.active { background: linear-gradient(135deg, #eff6ff, #e7f1ff); color: var(--accent); border-color: #cfe0fb; box-shadow: inset 3px 0 0 var(--accent), 0 14px 26px -24px rgba(37, 99, 235, .62); }
.nav-icon { width: 27px; height: 27px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 1rem; background: linear-gradient(180deg, #ffffff, #f8fafc); color: var(--text-secondary); flex-shrink: 0; border: 1px solid rgba(226, 232, 240, .8); }
.nav-item.active .nav-icon { background: var(--accent-gradient); color: white; border-color: transparent; }
.nav-item small { margin-left: auto; padding: 2px 5px; border-radius: 5px; background: var(--bg-gray-dark); color: var(--text-tertiary); font-size: .52rem; }
.sidebar-collapse { margin: 8px 12px 12px; min-height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 12px; border: 1px solid #dbe3ee; border-radius: 11px; background: linear-gradient(180deg, #ffffff, #f8fafc); color: var(--text-secondary); font-size: .72rem; font-weight: 800; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease, color .18s ease; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .82); }
.sidebar-collapse:hover { color: var(--accent); border-color: var(--border-focus); background: linear-gradient(180deg, #ffffff, #eef6ff); transform: translateY(-1px); box-shadow: 0 14px 24px -22px rgba(15, 23, 42, .62), inset 0 1px 0 rgba(255, 255, 255, .9); }
.sidebar-budget-total { display: none; }
.sidebar-collapsed .brand-lockup > div:last-child, .sidebar-collapsed .nav-item span, .sidebar-collapsed .nav-item small, .sidebar-collapsed .nav-section-label, .sidebar-collapsed .sidebar-collapse span { display: none; }
.sidebar-collapsed .sidebar-header { justify-content: center; padding-inline: 10px; }
.sidebar-collapsed .brand-mark { width: 42px; }
.sidebar-collapsed .nav-menu { padding-inline: 10px; }
.sidebar-collapsed .nav-item { justify-content: center; padding-inline: 7px; }
.sidebar-collapsed .nav-item:hover { transform: none; }
.sidebar-collapsed .sidebar-collapse { justify-content: center; padding: 0; }
.sidebar-collapsed .sidebar-collapse i { transform: rotate(180deg); }

.stats-card { margin: 16px; padding: 18px; background: linear-gradient(180deg, #ffffff 0%, var(--accent-soft) 100%); border-radius: 16px; border: 1px solid var(--border-focus); box-shadow: var(--shadow-sm); }
.stats-title { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-tertiary); margin-bottom: 16px; }
.stat-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--border-light); }
.stat-item:last-child { border-bottom: none; }
.stat-label { color: var(--text-secondary); font-weight: 500; font-size: 0.85rem; }
.stat-value { font-weight: 700; font-size: 0.95rem; color: var(--text-primary); }
.stat-value.highlight { color: var(--accent); font-size: 1.25rem; font-weight: 800; }

/* COMPONENTES TOPBAR (MENU DO USUÃRIO) */
.user-info-wrapper { position: relative; min-width: 0; flex: 0 1 auto; }
.user-info { min-width: 0; max-width: 230px; display: flex; align-items: center; gap: 10px; background: var(--bg-white); padding: 5px 10px 5px 5px; border-radius: 14px; border: 1px solid var(--border-light); cursor: pointer; transition: all 0.2s; box-shadow: var(--shadow-sm); }
.user-info:hover { border-color: var(--border-focus); background: white; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.user-avatar { width: 40px; height: 40px; background: var(--accent-gradient); border-radius: 12px; display: flex; align-items: center; justify-content: center; color: white; font-size: 1.2rem; flex-shrink: 0; }
.user-info-text { min-width: 0; max-width: 145px; display: flex; flex-direction: column; gap: 2px; }
.user-info-text h4,
.user-info-text span { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.2; }
.user-info > .ph-caret-down { flex: 0 0 auto; margin-left: 0 !important; }

.user-dropdown { position: absolute; top: calc(100% + 12px); right: 0; background: var(--bg-white); border: 1px solid var(--border-light); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); width: 240px; padding: 8px 0; z-index: 1000; opacity: 0; visibility: hidden; transform: translateY(-10px); transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); }
.user-dropdown.active { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-header { padding: 12px 20px; font-size: 0.8rem; font-weight: 700; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.dropdown-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 20px; background: transparent; border: none; font-size: 0.95rem; font-weight: 700; color: var(--text-secondary); cursor: pointer; transition: background .18s ease, color .18s ease; text-align: left; }
.dropdown-item i { font-size: 1.2rem; color: var(--text-tertiary); transition: all 0.2s; }
.dropdown-item:hover { background: linear-gradient(90deg, var(--accent-soft), #ffffff); color: var(--text-primary); }
.dropdown-item:hover i { color: var(--accent); }
.dropdown-item.text-danger { color: var(--danger); }
.dropdown-item.text-danger i { color: var(--danger); }
.dropdown-item.text-danger:hover { background: #fef2f2; }
.dropdown-divider { height: 1px; background: var(--border-light); margin: 8px 0; }
