﻿@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@100..900&display=swap');

:root { /* COR CONDOSYNC */
    /* Cores de Marca / Base */
    --primary-color: #0069fe;
    --secondary-color: #0069fe;
    --tertiary-color: #cad8fa;
    --sidebar-bg: #0c3966;
    --sidebar-navyblue-tertiary: #162154;
    /* Cores de Fundo / Superfície */
    --primary-bg: #f4f5f8;
    --card-bg: #ffffff;
    --surface-light: #f1f5f9;
    /* Texto & Limites */
    --text-dark: #475569;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --border-focus: #93c5fd;
    --border-dashed: #cbd5e1;
    /* Cores de Utilitário */
    --blue: #3b82f6;
    --blue-hover: #2563eb;
    --yellow: #f59e0b;
    --green: #22c55e;
    --green-hover: #056d2c;
    --red: #ef4444;
    --red-hover: #f58a8a;
    --text-orange: #FE4901;
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Lexend", sans-serif;
}

body {
    background-color: var(--primary-bg);
    color: var(--text-dark);
}

.dashboard {
    display: flex;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.header {
    margin-bottom: 10px
}

/* Sidebar Styles */
.sidebar {
    width: 250px;
    background-color: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    position: relative;
    z-index: 100;
}

    .sidebar.collapsed {
        width: 70px;
    }

.sidebar-header {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    overflow: hidden;
}

.sidebar-close {
    display: none;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.sidebar-toggle-desktop {
    position: absolute;
    bottom: 50%;
    right: -15px;
    width: 30px;
    height: 30px;
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 101;
    transition: transform 0.3s ease;
}

.sidebar.collapsed .sidebar-toggle-desktop {
    transform: rotate(180deg);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding-top: 15px;
    min-height: 0;
}

.sidebar ul {
    list-style: none;
}

    .sidebar ul li {
        position: relative;
    }

        .sidebar ul li a {
            display: flex;
            align-items: center;
            padding: 14px 24px;
            color: #fff;
            text-decoration: none;
            font-size: 0.95rem;
            font-weight: 500;
            transition: background-color 0.2s, color 0.2s;
            gap: 16px;
            white-space: nowrap;
            overflow: hidden;
        }

            .sidebar ul li a span {
                transition: opacity 0.3s ease;
            }

.sidebar.collapsed ul li a span {
    opacity: 0;
    pointer-events: none;
}

.sidebar ul li a i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.sidebar ul li a:hover {
    background-color: var(--primary-color);
    color: white;
}

.sidebar ul li.active > a {
    background-color: var(--primary-color);
    color: white;
}

/* Sidebar Logo Transition */
.sidebar .logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.sidebar .logo-normal {
    display: block;
}

.sidebar .logo-collapsed {
    display: none;
}

.sidebar.collapsed .sidebar-header {
    padding: 0;
    justify-content: center;
}

.sidebar.collapsed .logo {
    padding: 0;
}

.sidebar.collapsed .logo-normal {
    display: none;
}

.sidebar.collapsed .logo-collapsed {
    display: block;
}

.sidebar.collapsed .logo i {
    font-size: 1.5rem;
    margin-right: 0;
}

.sidebar-footer {
    padding-bottom: 20px;
}

/* Main Content Layout */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 24px 32px;
    transition: margin-left 0.3s ease;
}

/* Top Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    height: 60px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.page-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

    .page-title h1 {
        font-size: 1.6rem;
        font-weight: 600;
        color: var(--sidebar-bg);
    }

.mobile-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.6rem;
    color: var(--sidebar-bg);
    cursor: pointer;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 16px;
    width: 260px;
}

    .search-bar input {
        border: none;
        outline: none;
        margin-left: 10px;
        font-size: 1rem;
        width: 100%;
    }

        .search-bar input::placeholder {
            color: #94a3b8;
        }

    .search-bar i {
        color: var(--text-muted);
    }

.notifications {
    position: relative;
    cursor: pointer;
}

    .notifications i {
        font-size: 1.3rem;
        color: var(--text-dark);
    }

.badge-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background-color: var(--red);
    border-radius: 50%;
    border: 2px solid var(--primary-bg);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.user-name {
    font-weight: 500;
    font-size: 0.95rem;
}

/* User Profile Dropdown Styling */
.dropdown-container {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 240px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

    .dropdown-menu.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

.dropdown-header {
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px 8px 0 0;
    display: flex;
    flex-direction: column;
}

    .dropdown-header strong {
        color: var(--text-dark);
        font-size: 0.95rem;
    }

    .dropdown-header span {
        color: var(--text-muted);
        font-size: 0.8rem;
        margin-top: 2px;
    }

.dropdown-item {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.95rem;
    transition: background-color 0.2s;
}

    .dropdown-item i {
        color: var(--text-muted);
        width: 16px;
        text-align: center;
    }

    .dropdown-item:hover {
        background-color: #f1f5f9;
    }

.dropdown-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 4px 0;
}

.text-red {
    color: var(--red) !important;
}

    .text-red i {
        color: var(--red) !important;
    }

    .text-red:hover {
        background-color: #fee2e2 !important;
    }

.desktop-only {
    display: flex;
}

.mobile-only {
    display: none !important;
}

@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: flex !important;
    }

    .main-content {
        padding: 24px 32px 75px 32px;
    }
}


/* KPI Sections & Charts */
.kpi-section {
    display: flex;
    align-items: flex-start;
    /* Prevents button from stretching to full height */
    gap: 20px;
    margin-bottom: 15px;
}

.kpi-cards {
    display: flex;
    gap: 20px;
    flex: 1;
}

.kpi-card,
.kpi-card-navyblue {
    border-radius: 10px;
    padding: 14px;
    flex: 1;
    box-shadow: 0 5px 5px #c1c6cd;
    position: relative;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.kpi-card {
    background-color: var(--tertiary-color);
    border: 1px solid var(--tertiary-color);
}

.kpi-card-navyblue {
    background-color: var(--sidebar-navyblue-tertiary);
    border: 1px solid var(--sidebar-navyblue-tertiary);
}

    /* Quando passas o rato */
    .kpi-card:hover,
    .kpi-card-navyblue:hover {
        transform: translateY(-5px);
        /* sobe */
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
        /* sombra maior */
    }

.kpi-value,
.kpi-value-navyblue {
    font-size: 1.7rem;
    font-weight: 250;
    text-align: end;
}

.kpi-value-navyblue {
    color: var(--tertiary-color);
}

.kpi-title {
    color: var(--text-orange);
}

.kpi-title-navyblue {
    color: #fff;
}

/* Charts container inside KPI cards */
.kpi-chart {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 45px;
}

    .kpi-chart svg {
        width: 100%;
        height: 100%;
        display: block;
    }


/* Modal System - Premium Redesign */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

    .modal-overlay.active {
        display: flex;
        opacity: 1;
    }

.modal-container {
    background: white;
    width: 100%;
    max-width: 580px;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-header {
    padding: 24px 32px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    z-index: 10;
}

    .modal-header h2 {
        font-size: 1.25rem;
        font-weight: 700;
        color: var(--text-orange);
    }

.modal-body {
    padding: 32px;
    overflow-y: auto;
    flex: 1;
}

/* Form Styles inside Modals */
.form-group {
    margin-bottom: 24px;
}

    .form-group:last-child {
        margin-bottom: 0;
    }

    .form-group span {
        display: block;
        margin-bottom: 8px;
        font-size: 0.875rem;
        font-weight: 600;
        color: #475569;
    }

    .form-group input:not([type="submit"]):not([type="button"]),
    .form-group select,
    .form-group textarea {
        width: 100%;
        padding: 12px 16px;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        font-size: 0.95rem;
        color: var(--text-dark);
        background-color: #f8fafc;
        transition: all 0.2s ease;
        outline: none;
    }

        .form-group input:focus,
        .form-group select:focus,
        .form-group textarea:focus {
            border-color: var(--primary-color);
            background-color: white;
            box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
        }

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
}

    .form-row .form-group {
        flex: 1;
        margin-bottom: 0;
    }

.modal-footer {
    padding: 24px 32px;
    border-top: 1px solid #f1f5f9;
    background: #f8fafc;
    display: flex;
    justify-content: flex-end;
    gap: 16px;
}

    .modal-footer button {
        padding: 12px 24px;
        border-radius: 12px;
        font-weight: 600;
        font-size: 0.95rem;
        transition: all 0.2s ease;
    }

/* Activity Items - Premium Card Design */
.activity-item {
    background: white;
    border: 1px solid #f1f5f9;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: start;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

    .activity-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    }

    .activity-item .main-icon {
        width: 40px;
        height: 40px;
        background: #f1f5f9;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--primary-color);
        font-size: 1.1rem;
    }

    .activity-item .date {
        font-size: 0.75rem;
        color: var(--text-muted);
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        margin-bottom: 4px;
        display: block;
    }

    .activity-item .content {
        font-size: 0.95rem;
        line-height: 1.5;
        color: var(--text-dark);
    }

    .activity-item .item-actions {
        display: flex;
        gap: 8px;
        opacity: 0;
        transition: opacity 0.2s ease;
    }

    .activity-item:hover .item-actions {
        opacity: 1;
    }

    .activity-item .item-actions .icon-btn {
        width: 32px;
        height: 32px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #f8fafc;
        color: var(--text-muted);
        transition: all 0.2s;
    }

    .activity-item .item-actions .edit-note-btn:hover {
        background: #dbeafe;
        color: var(--primary-color);
    }

    .activity-item .item-actions .delete-note-btn:hover {
        background: #fee2e2;
        color: var(--red);
    }

    /* Quick Edit Mode */
    .activity-item.editing {
        grid-template-columns: 1fr;
        border-color: var(--primary-color);
        background: #eff6ff;
    }

        .activity-item.editing .main-icon,
        .activity-item.editing .date,
        .activity-item.editing .item-actions {
            display: none;
        }

        .activity-item.editing .edit-container {
            display: flex;
            gap: 12px;
            width: 100%;
        }

/* Grid Layout for Content Cards */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.left-col,
.right-col {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Reusable Card Styles */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--primary-color);
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

    .card-header h2 {
        font-size: 1.2rem;
        font-weight: 600;
        color: white;
    }

    .card-header.expandable {
        cursor: pointer;
    }

.card-actions i {
    color: white;
    margin-left: 12px;
    cursor: pointer;
    font-size: 1.1rem;
}

/* Opportunities Table */
.opportunities-table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
    /* Changed from white to transparent */
}

    .opportunities-table th,
    .opportunities-table td {
        padding: 10px 12px;
        text-align: left;
        font-size: 1rem;
        border-bottom: 1px solid var(--border-color);
    }

    .opportunities-table th {
        color: var(--text-muted);
        font-weight: 500;
    }

        .opportunities-table th i {
            font-size: 0.8rem;
            margin-left: 5px;
        }

    .opportunities-table tbody tr:last-child td {
        border-bottom: none;
    }

.deal-name {
    color: var(--primary-color);
    font-weight: 500;
}

.badge {
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    color: white;
}

.badge-blue {
    background-color: var(--blue);
}

.badge-yellow {
    background-color: var(--yellow);
    color: white;
}

.badge-green {
    background-color: var(--green);
}

.badge-red {
    background-color: var(--red);
}

.badge-gray {
    background-color: #e2e8f0;
    color: #475569;
}

/* Notes and Activity Text */
.add-note-section {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    background-color: #f8fafc;
}

    .add-note-section input {
        flex: 1;
        padding: 8px 14px;
        border: 1px solid var(--border-color);
        border-radius: 6px;
        font-size: 1rem;
        outline: none;
        transition: border-color 0.2s;
    }

        .add-note-section input:focus {
            border-color: var(--primary-color);
        }

.activity-list {
    padding: 10px 20px;
}

.activity-item {
    padding: 16px 8px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    /* For absolutely positioned actions or flexible layout */
}

    .activity-item:last-child {
        border-bottom: none;
    }

    .activity-item i.main-icon {
        color: var(--text-muted);
        background: #f1f5f9;
        padding: 10px;
        border-radius: 6px;
        font-size: 1rem;
    }

    .activity-item .date {
        font-size: 0.85rem;
        color: var(--text-muted);
        white-space: nowrap;
    }

    .activity-item .content {
        font-size: 0.95rem;
        flex: 1;
        /* Pushes item-actions to the right */
    }

    .activity-item.editing input {
        flex: 1;
        padding: 6px 10px;
        border: 1px solid var(--primary-color);
        border-radius: 4px;
        font-size: 0.95rem;
        outline: none;
    }

/* Edit / Delete Buttons common styles */
.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

    .icon-btn:hover {
        background-color: #f1f5f9;
        color: var(--text-dark);
    }

    .icon-btn.text-red:hover {
        background-color: #fee2e2;
        color: var(--red);
    }

.item-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.activity-item:hover .item-actions,
.opp-row:hover .row-actions {
    opacity: 1;
}

.row-actions {
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* Client Details Component */
.client-info {
    padding: 24px 20px;
}

.client-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

    .client-profile img {
        width: 64px;
        height: 64px;
        border-radius: 50%;
        object-fit: cover;
    }

.client-names h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.client-names p {
    font-size: 1rem;
    color: var(--text-muted);
}

.client-contact {
    margin-bottom: 24px;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 20px;
}

    .client-contact p {
        font-size: 1.2rem;
        color: var(--text-muted);
        margin-bottom: 12px;
        display: flex;
        align-items: center;
        gap: 12px;
    }

        .client-contact p:last-child {
            margin-bottom: 0;
        }

.client-tags {
    display: flex;
    gap: 10px;
}

.tag {
    padding: 5px 14px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    color: white;
}

.tag-green {
    background-color: var(--green);
}

.tag-blue {
    background-color: var(--blue);
}

/* Upcoming Tasks List */
.tasks-list {
    padding: 5px 20px 10px;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: opacity 0.2s;
}

    .task-item:last-child {
        border-bottom: none;
    }

    .task-item.completed {
        opacity: 0.5;
    }

        .task-item.completed .task-content {
            text-decoration: line-through;
        }

.task-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

    .task-icon.blue {
        background-color: var(--blue);
    }

    .task-icon.yellow {
        background-color: var(--yellow);
    }

    .task-icon.red {
        background-color: var(--red);
    }

.task-content {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 500;
}

.task-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile-First Functional Overhaul */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    padding: 0 10px;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
    /* Added shadow for depth */
}

.body-lock {
    overflow: hidden !important;
}

.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    gap: 4px;
    transition: color 0.2s;
}

    .mobile-bottom-nav .nav-item.active {
        color: var(--primary-color);
        font-weight: 600;
    }

        .mobile-bottom-nav .nav-item.active i {
            transform: translateY(-2px);
            transition: transform 0.2s ease;
        }

    .mobile-bottom-nav .nav-item i {
        font-size: 1.25rem;
    }

.nav-item-placeholder {
    width: 60px;
    /* Space for FAB */
}

.fab-btn {
    display: none;
    position: fixed;
    bottom: 35px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
    background: var(--sidebar-bg);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    z-index: 1001;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.search-overlay {
    position: fixed;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 2000;
    transition: top 0.3s ease;
    padding: 20px;
}

    .search-overlay.active {
        top: 0;
    }

.search-overlay-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

    .search-overlay-header button {
        background: none;
        border: none;
        font-size: 1.2rem;
        color: var(--sidebar-bg);
    }

    .search-overlay-header input {
        flex: 1;
        padding: 14px 18px;
        border: 1px solid var(--border-color);
        border-radius: 12px;
        font-size: 1rem;
        outline: none;
        background: #f1f5f9;
    }

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: -105%;
        /* More than 100% to ensure absolutely hidden */
        width: 85%;
        max-width: 300px;
        height: 100vh;
        height: 100dvh;
        z-index: 2000;
        transition: left 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        background: var(--sidebar-bg);
        box-shadow: 10px 0 25px rgba(0, 0, 0, 0.2);
    }

        .sidebar .logo-text {
            opacity: 1 !important;
            display: inline !important;
            pointer-events: auto !important;
        }

        .sidebar.mobile-active {
            left: 0;
        }

    .sidebar-close {
        display: block;
    }

    .sidebar-toggle-desktop {
        display: none;
    }

    .top-header {
        position: fixed;
        /* Fix to top */
        top: 0;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        z-index: 1000;
        padding: 0 15px;
        border-bottom: 1px solid var(--border-color);
        height: 60px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        box-sizing: border-box;
    }

    .header-left {
        display: flex;
        align-items: center;
        gap: 10px;
    }

        .header-left .page-title h1 {
            font-size: 1.6rem;
            font-weight: 700;
            color: var(--sidebar-bg);
            margin: 0;
        }

    .user-profile {
        display: flex !important;
        align-items: center;
    }

        .user-profile .user-name {
            display: none;
            /* Hide name on small mobile, keep icon/avatar */
        }

        .user-profile i.fa-chevron-down {
            display: none;
        }

    /* KPI Overhaul for Mobile */
    .kpi-section {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

        .kpi-section .btn-primary {
            order: -1;
            /* Move New Deal button to top */
            width: 100%;
            justify-content: center;
            margin-bottom: 5px;
        }

    .kpi-cards {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .kpi-card {
        padding: 15px;
        padding-bottom: 40px;
    }

    .kpi-value {
        font-size: 1.4rem;
    }

    .kpi-title {
        font-size: 0.8rem;
    }

    .kpi-title-navyblue {
        font-size: 0.8rem;
    }

    .mobile-bottom-nav,
    .fab-btn {
        display: flex;
    }

    /* Table to Card View */
    .opportunities-table thead {
        display: none;
    }

    .opportunities-table,
    .opportunities-table tbody {
        display: block;
        width: 100%;
        background: transparent !important;
        border: none !important;
    }

        .opportunities-table tr {
            display: flex;
            flex-direction: column;
            width: 100%;
        }

        .opportunities-table tr {
            background: white;
            border: 1px solid var(--border-color);
            border-radius: 12px;
            margin-bottom: 16px;
            padding: 0;
            position: relative;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .opportunities-table td {
            border-bottom: 1px solid #f1f5f9;
            padding: 12px 16px;
            text-align: left;
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 1rem;
        }

            .opportunities-table td:last-child {
                border-bottom: none;
                background: #f8fafc;
            }

            .opportunities-table td::before {
                content: attr(data-label);
                font-weight: 600;
                color: var(--text-muted);
                font-size: 0.75rem;
                text-transform: uppercase;
                letter-spacing: 0.025em;
            }

    .deal-name {
        font-size: 1rem;
        font-weight: 700 !important;
        color: var(--primary-color);
        background: #f8fafc;
        border-bottom: 1px solid var(--border-color) !important;
        width: 100% !important;
        padding: 14px 16px !important;
    }

        .deal-name::before {
            display: none !important;
        }

    .badge {
        font-size: 1rem;
        padding: 4px 10px;
    }

    .activity-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        position: relative;
        padding: 16px 0;
        border-bottom: 1px solid #f1f5f9;
    }

        .activity-item .content {
            width: 100%;
            line-height: 1.5;
        }

        .activity-item .item-actions {
            display: flex !important;
            opacity: 1 !important;
            visibility: visible !important;
            position: static;
            width: 100%;
            justify-content: flex-end;
            gap: 15px;
            padding-top: 8px;
        }

            .activity-item .item-actions .icon-btn {
                width: 40px;
                height: 40px;
                display: flex;
                align-items: center;
                justify-content: center;
                background: #f8fafc;
                border-radius: 10px;
                font-size: 1.1rem;
            }

    /* Modal Reconstruction - Single Column Stack */
    .modal-overlay {
        padding: 0;
    }

    .modal-container {
        max-width: none;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        transform: translateY(100%);
    }

    .modal-overlay.active .modal-container {
        transform: translateY(0);
    }

    .modal-body {
        padding: 24px 20px;
    }

    .form-row {
        flex-direction: column;
        gap: 24px;
    }

    .modal-footer {
        flex-direction: column;
        padding: 20px;
        background: white;
    }

        .modal-footer button {
            width: 100%;
            height: 52px;
            order: 1;
        }

        .modal-footer .btn-secondary {
            order: 2;
            background: transparent;
            border: none;
        }

    /* Activity Items Mobile */
    .activity-item {
        grid-template-columns: 1fr;
        padding: 20px;
    }

        .activity-item .main-icon {
            display: none;
        }

        .activity-item .item-actions {
            opacity: 1;
            margin-top: 12px;
            padding-top: 12px;
            border-top: 1px solid #f1f5f9;
            justify-content: flex-end;
        }
}

/* Custom Desktop Top Navbar */
.desktop-top-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 32px;
    background-color: var(--sidebar-bg);
    margin: -24px -32px 24px -32px;
    border-radius: 0;
    gap: 20px;
    border-bottom: none;
}

.top-nav-info {
    display: flex;
    align-items: center;
    gap: 24px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    font-weight: 500;
}

    .top-nav-info .info-item {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .top-nav-info .text-warning {
        color: var(--yellow) !important;
    }

        .top-nav-info .text-warning i {
            color: var(--yellow) !important;
        }

.top-nav-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.top-nav-icons {
    display: flex;
    gap: 15px;
    align-items: center;
}

    .top-nav-icons a {
        color: rgba(255, 255, 255, 0.8);
        font-size: 1.05rem;
        transition: all 0.2s;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background-color: transparent;
        text-decoration: none;
    }

        .top-nav-icons a:hover {
            color: white;
            background-color: rgba(255, 255, 255, 0.2);
        }

.top-nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    color: white;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding-left: 20px;
    cursor: pointer;
}

    .top-nav-user .user-avatar {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--blue), var(--primary-color));
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.95rem;
        font-weight: 600;
        letter-spacing: 1px;
        text-transform: uppercase;
        overflow: hidden;
        border: 2px solid rgba(255, 255, 255, 0.2);
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }

img.user-avatar {
    padding: 0;
    background: transparent;
    object-fit: cover;
}

.simple-dropdown {
    top: calc(100% + 15px) !important;
    right: 0 !important;
    background-color: white !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid var(--border-color) !important;
    min-width: 200px !important;
    padding: 8px 0 !important;
    color: var(--text-dark) !important;
}

    .simple-dropdown::before {
        content: '';
        position: absolute;
        top: -6px;
        right: 20px;
        width: 12px;
        height: 12px;
        background-color: white;
        transform: rotate(45deg);
        border-top: 1px solid var(--border-color);
        border-left: 1px solid var(--border-color);
    }

/* Sidebar Submenus */
.sidebar ul li a.has-submenu {
    justify-content: flex-start;
}

    .sidebar ul li a.has-submenu .submenu-icon {
        font-size: 0.8rem;
        transition: transform 0.3s ease;
        width: auto;
        margin-left: auto;
    }

.sidebar ul li.submenu-open > a.has-submenu .submenu-icon {
    transform: rotate(180deg);
}

.sidebar ul li .submenu {
    display: none;
    background-color: rgba(0, 0, 0, 0.1);
    padding-left: 0;
}

.sidebar ul li.submenu-open > .submenu {
    display: block;
}

.sidebar ul li .submenu li a {
    font-size: 0.85rem;
    padding: 14px 40px;
}

/* Submenus in Collapsed Mode */
.sidebar.collapsed .sidebar-nav {
    overflow: visible;
    /* Prevent cutting off absolute submenus */
}

.sidebar.collapsed ul li .submenu {
    display: none;
    position: absolute;
    left: 70px;
    top: 0;
    /*width: 200px;*/
    background-color: var(--primary-color);
    padding: 10px 0;
    border-radius: 0 8px 8px 0;
    box-shadow: 4px 4px 15px rgba(0, 0, 0, 0.15);
    z-index: 1000;
}

.sidebar.collapsed ul li:hover .submenu,
.sidebar.collapsed ul li.submenu-open > .submenu {
    display: block !important;
}

.sidebar.collapsed ul li .submenu li a {
    padding-left: 20px;
    font-size: 0.9rem;
}

    .sidebar.collapsed ul li .submenu li a:before {
        display: none;
    }

    .sidebar.collapsed ul li .submenu li a span {
        opacity: 1;
        pointer-events: auto;
    }

.sidebar.collapsed ul li a.has-submenu .submenu-icon {
    display: none;
}



/* Base Container */
.activity-wrapper {
    background-color: #f1f5f9;
    font-family: inherit;
    border: 1px solid var(--border-color);
}

/* Top Toolbar */
.top-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: nowrap;
    gap: 15px;
    border-radius: 8px 8px 0 0;
    overflow-x: auto;
    /* allows scrolling if screen is too narrow but keeps it inline */
}

    /* Make toolbar buttons match the height and styling of filter inputs */
    .top-toolbar .btn {
        height: 28px;
        padding: 0 16px;
        font-size: 0.75rem;
        border-radius: 4px;
        white-space: nowrap;
        /* Prevent button text like 'Limpar Filtros' from breaking into two lines */
    }

.toolbar-left,
.toolbar-right {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: nowrap;
    /* Avoid wrapping so everything stays on one line on desktop */
}

    .toolbar-left > span {
        display: flex;
        align-items: center;
        gap: 5px;
    }

.toolbar-center {
    display: flex;
    /* ðŸ”¥ isto Ã© o mais importante */
    align-items: center;
    /* ðŸ”¥ alinha verticalmente */
    justify-content: center;
    /* centra horizontalmente */
    gap: 8px;
    flex-grow: 1;
    flex-wrap: nowrap;
}

    .toolbar-center input[type="date"] {
        flex: 1;
        /* ðŸ”¥ ocupa espaÃ§o disponÃ­vel */
        min-width: 120px;
        /* ðŸ”¥ nunca fica demasiado pequeno */
        max-width: 180px;
        /* ðŸ”¥ nunca cresce demais */
    }

.logo-title {
    font-size: 1.8rem;
    font-weight: normal;
    color: var(--sidebar-bg);
    margin: 0;
}

    .logo-title span {
        color: var(--primary-color);
    }

/* Table Container for Sticky Scroll */
.table-container {
    width: 100%;
    max-height: 70vh;
    /* Replaces activity-wrapper height lock */
    overflow: auto;
    background: #fff;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.activity-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    min-width: 1400px;
}

    .activity-table th,
    .activity-table td {
        padding: 10px 12px;
        border-bottom: 1px solid #e2e8f0;
        text-align: left;
        vertical-align: middle;
        /* Align to top when large data wraps */
        line-height: 1.4;
    }

/* Prevent small columns like dates/numbers/icons from wrapping */
/*.activity-table td:nth-child(5),*/
/* NÂº Proposta */
/*.activity-table td:nth-child(6),*/
/* Data */
/*.activity-table td:nth-child(8),*/
/* Valor */
/*.activity-table td:nth-child(11) {*/
/* Data Contacto */
/*white-space: nowrap;
        }*/

/* Fixed Headings & Filters */
.main-header th {
    background-color: var(--primary-color);
    color: #fff;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 11;
    white-space: nowrap;
}

.colaborador-cell {
    display: flex;
    align-items: center;
    /* ðŸ”¥ centra verticalmente */
    gap: 8px;
    /* espaÃ§o entre imagem e texto */
}

.grid-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    /* opcional: imagem redonda */
    object-fit: cover;
}

.filter-header th {
    background-color: #f8fafc;
    position: sticky;
    top: 36px;
    /* Offset below main header */
    z-index: 10;
    border-bottom: 2px solid #e2e8f0;
    padding: 6px 8px;
}

.filter-input,
.filter-select {
    width: 100%;
    padding: 5px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #334155;
    background: #fff;
    box-sizing: border-box;
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    display: inline-block;
    white-space: nowrap;
}

.badge-media {
    background: #fef08a;
    color: #854d0e;
}

.badge-quente {
    background: #fca5a5;
    color: #991b1b;
}

.badge-frio {
    background: #bae6fd;
    color: #075985;
}

.badge-nao {
    background: #fca5a5;
    color: #991b1b;
}

.date-badge-green,
.date-badge-red,
.date-badge-yellow {
    border: 1px solid #cbd5e1;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

.date-badge-green {
    background: #9ef9a1;
    color: #000000;
}

.date-badge-red {
    background: #FF6961;
    color: #FFFFFF;
}

.date-badge-yellow {
    background: #FDFD96;
    color: #000000;
}

.btn {
    border: none;
    border-radius: 6px;
    padding: 0 24px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 40px;
    /* Specific height instead of auto */
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

    .btn-primary:hover {
        background-color: var(--secondary-color);
    }

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

    .btn-secondary:hover {
        background-color: var(--primary-color);
    }

.btn-danger {
    background-color: var(--red);
    color: white;
}

    .btn-danger:hover {
        background-color: var(--red-hover);
    }

.btn-success {
    background-color: var(--green);
    color: white;
}

    .btn-success:hover {
        background-color: var(--green-hover);
    }

.btn-outline-primary {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

    .btn-outline-primary:hover {
        background-color: var(--primary-color);
        color: white;
    }

.btn-outline-secondary {
    background-color: transparent;
    color: var(--secondary-color);
    border: 1px solid var(--secondary-color);
}

    .btn-outline-secondary:hover {
        background-color: var(--primary-color);
        color: white;
    }

/* Footer & Pagination */
.footer-section {
    background: #fff;
    padding: 15px 20px;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.summary-bar {
    background-color: var(--tertiary-color);
    color: #fff;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    border-radius: 4px;
    font-size: 0.85rem;
    margin-bottom: 15px;
}

.pagination {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.page-item {
    padding: 6px 12px;
    border: 1px solid #cbd5e1;
    background: #fff;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--primary-color);
    text-decoration: none;
}

    .page-item.active {
        background: var(--primary-color);
        color: #fff;
        border-color: var(--primary-color);
    }

.action-icons {
    white-space: nowrap;
    /* Prevents icons from stacking vertically */
}

    .action-icons i {
        margin-right: 8px;
        cursor: pointer;
        color: var(--secondary-color);
        font-size: 1rem;
        display: inline-block;
    }
    .action-icons a {
        margin-right: 8px;
        cursor: pointer;
        color: var(--secondary-color);
        display: inline-block;
        text-decoration: none;
    }

.mobile-filters-trigger {
    display: none;
}

.mobile-filters-panel {
    display: none;
}


/* =========================================
           Mobile Layout (Block Approach)
        ========================================= */
@media (max-width: 1024px) {
    .activity-wrapper {
        padding: 10px;
    }

    /* Mobile Toolbar: Stack buttons cleanly */
    .top-toolbar {
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
        gap: 15px;
    }

    .toolbar-center {
        order: -1;
        /* Move title to very top */
        text-align: left;
        width: 100%;
    }

    .toolbar-left,
    .toolbar-right {
        flex-direction: column;
        width: 100%;
        gap: 10px;
        align-items: stretch;
    }

        .toolbar-left > span {
            margin-bottom: 5px;
            /* Spacing for the 'Mostrar X leads' */
        }

    .btn-outline,
    .btn-outline-primary,
    .btn-primary,
    .btn-secondary {
        /*width: 100%;*/
        /* Full width buttons internally */
    }

    .table-container {
        max-height: none;
        /* Let the page natively scroll */
        background: transparent;
        box-shadow: none;
    }

    /* Hide Desktop Headers */
    .activity-table thead {
        display: none;
    }

    /* Mobile Filter Reveal */
    .mobile-filters-trigger {
        margin-top: 10px;
        display: block;
        width: 100%;
        background: #fff;
        padding: 15px;
        text-align: left;
        color: var(--primary-color);
        font-weight: 600;
        cursor: pointer;
        border: 1px solid #e2e8f0;
        border-bottom: none;
    }

    .mobile-filters-panel {
        flex-direction: column;
        padding: 15px;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-bottom: none;
        gap: 10px;
    }

        .mobile-filters-panel.active {
            display: flex;
        }

    /* Row Structure */
    .activity-table {
        min-width: 100%;
        display: block;
    }

        .activity-table tbody {
            display: block;
        }

        .activity-table tr {
            display: block;
            background: #fff;
            padding: 15px;
            margin-bottom: 15px;
            border-top: 4px solid var(--primary-color);
            /* Colored top accent instead of full box border */
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        }

        /* 
             * Display BLOCK on TD prevents pseudo-element and icons from acting as flex children.
             * This stops icons from stacking vertically!
             */
        .activity-table td {
            display: block;
            padding: 10px 0;
            border-bottom: 1px solid #f1f5f9;
            /* Subtle separator for row fields */
            text-align: left;
            word-wrap: break-word;
            /* Wrap large data to prevent breaking alignment */
            overflow-wrap: break-word;
            word-break: break-word;
            white-space: normal;
            /* Force standard text flow */
        }

            .activity-table td:last-child {
                border-bottom: none;
            }

            /* Action icons spacing horizontally */
            .activity-table td.action-icons i,
            .activity-table td.action-icons a {
                display: inline-block !important;
                /* Forces side by side */
                margin-right: 15px;
                margin-top: 5px;
            }

            /* Labels */
            .activity-table td::before {
                content: attr(data-label);
                display: block;
                font-size: 0.75rem;
                color: #64748b;
                text-transform: uppercase;
                margin-bottom: 5px;
                font-weight: 600;
            }

    .filter-input,
    .filter-select {
        width: 100%;
    }

    .footer-section {
        padding: 15px;
    }

    .summary-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .pagination {
        justify-content: flex-start;
    }
}
