/* Logo */
.logo {
    font-size: 22px;
    font-weight: 700;
}
.logo span {
    color: var(--primary);
}

/* Sidebar elements */
.menu-title {
    font-size: 12px;
    margin-bottom: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s ease;
    text-decoration: none;
}

.menu-item:hover {
    background: var(--primary-soft);
    color: var(--text);
}

.menu-item.active {
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 600;
}

.menu-item svg.icon {
    width: 18px;
    height: 18px;
    stroke-width: 2;
    stroke: currentColor;
}

.menu-item.active svg.icon {
    stroke: var(--primary);
}

/* Topbar */
.topbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

/* Profile Section (Melhorado) */
.profile {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 10px;
    transition: background 0.2s ease;
}

.profile:hover {
    background: var(--surface-2);
}

.profile-name {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    overflow: hidden;
    flex-shrink: 0;
}

.avatar img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    border-radius: 999px !important;
    max-width: 36px !important;
    max-height: 36px !important;
}

/* Dropdown (Melhorado) */
.dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    min-width: 200px;
    box-shadow: var(--shadow);
    overflow: hidden;
    z-index: 1000;
    opacity: 1;
    transform: translateY(0);
    transition: all 0.2s ease;
}

.dropdown.hidden {
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
}

.dropdown-item {
    display: block;
    padding: 12px 16px;
    cursor: pointer;
    color: var(--text);
    font-size: 14px;
    transition: all 0.15s ease;
    text-decoration: none;
    border-bottom: 1px solid var(--border);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: var(--primary-soft);
    padding-left: 20px;
}

.dropdown-item.logout {
    color: #dc2626;
}

.dropdown-item.logout:hover {
    background: #fef2f2;
}

/* ===============================
   NOTIFICATIONS
================================ */
.notifications-wrapper {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1.4;
    border: 2px solid white;
}

#notificationsDropdown {
    width: 320px;
    max-height: 360px; /* Header (~60px) + 4 itens (~280px) */
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.notifications-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notifications-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.mark-all-read-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.mark-all-read-btn:hover {
    background: var(--primary-soft);
}

.notifications-list {
    max-height: 280px; /* Altura para mostrar aproximadamente 4 itens */
    overflow-y: auto;
}

/* Scrollbar das notificações no tema escuro */
[data-theme="dark"] .notifications-list::-webkit-scrollbar {
    width: 8px;
}

[data-theme="dark"] .notifications-list::-webkit-scrollbar-track {
    background: var(--bg);
}

[data-theme="dark"] .notifications-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

[data-theme="dark"] .notifications-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.notification-item {
    display: flex;
    align-items: flex-start;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s ease;
    position: relative;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item:hover {
    background: var(--primary-soft);
}

.notification-item.unread {
    background: var(--primary-soft);
}

.notification-item.unread:hover {
    background: var(--primary-soft);
    opacity: 0.9;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-message {
    margin: 0 0 4px 0;
    font-size: 14px;
    color: var(--text);
    line-height: 1.4;
}

.notification-time {
    font-size: 12px;
    color: var(--text-muted);
}

.notification-dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    flex-shrink: 0;
    margin-left: 12px;
    margin-top: 6px;
}

.notifications-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

.notifications-empty svg {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    opacity: 0.5;
}

.notifications-empty p {
    margin: 0;
    font-size: 14px;
}

/* Tags */
.tag-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tag {
    background: var(--primary-soft);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    flex-shrink: 0;
}

.tag:hover {
    background: var(--primary-soft);
    opacity: 0.9;
    transform: translateY(-1px);
}

.tag.active {
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 600;
}

.tag.active svg {
    fill: var(--primary);
    stroke: var(--primary);
}

.tag svg {
    transition: all 0.2s ease;
    flex-shrink: 0;
}

/* Buttons (Melhorados) */
.btn-primary {
    padding: 10px 18px;
    border-radius: 999px;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline {
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
}

.btn-outline:hover {
    background: var(--surface-2);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.btn-outline:active {
    transform: translateY(0);
}