:root {
    --bg-body: #f5f6f8;
    --text-main: #020617;
    --text-muted: #64748b;
    --primary-color: #d323e2;
    --gradient-primary: linear-gradient(135deg, #d323e2 0%, #9605a2 100%);
    --sidebar-width: 260px;
    --header-height: 70px;
}

html, body{
    overflow-x: hidden;
}

/* BASE */
body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    padding-bottom: 80px; /* espaço para CTA fixo */
}

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 800;
}

.text-xs {
    font-size: 0.75rem;
}

.btn-primary-gradient {
    background: var(--gradient-primary);
    border: none;
    color: #fff;
    border-radius: 8px;
    padding: 0.5rem 1.2rem;
    font-weight: 500;
    transition: 0.2s;
}

.btn-primary-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(211, 35, 226, 0.3);
    color: #fff;
}

/* LOGIN FAKE */
.login-wrapper {
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.login-card {
    max-width: 400px;
    width: 100%;
    border: 0;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.15);
    padding: 2.5rem 2rem;
}

.login-card .form-control[disabled] {
    background: #fff;
}

.login-icon {
    width: 64px;
    height: 64px;
    border-radius: 999px;
    background: #f1f5f9;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: #fff;
    border-right: 1px solid #e2e8f0;
    z-index: 1040;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-logo {
    font-size: 1.3rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 2rem;
    padding-left: 0.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-link {
    color: var(--text-muted);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.25rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
    background: #fdf4ff;
    color: var(--primary-color);
}

.nav-link.active i {
    color: var(--primary-color);
}

.nav-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    font-weight: 700;
    margin: 1.5rem 0 0.5rem 1rem;
}

/* MAIN / TOPBAR */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 2rem;
    min-height: 100vh;
    transition: margin 0.3s;
}

.topbar {
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    margin: -2rem -2rem 2rem -2rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.topbar-badge {
    position: absolute;
    top: 0;
    left: 100%;
    transform: translate(-30%, 30%);
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #ef4444;
    border: 1px solid #fff;
}

/* CARDS / STATUS */
.card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.status-badge {
    padding: 0.35em 0.8em;
    font-size: 0.75em;
    font-weight: 600;
    border-radius: 6px;
}

.bg-success-subtle {
    background-color: #dcfce7 !important;
    color: #166534 !important;
}

.bg-warning-subtle {
    background-color: #fef9c3 !important;
    color: #854d0e !important;
}

.bg-danger-subtle {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
}

.bg-primary-subtle {
    background-color: #e0f2fe !important;
    color: #0369a1 !important;
}

.icon-badge {
    padding: 0.4rem 0.55rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* AVATAR CIRCLES */
.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* VIEW CONTROLLER */
.view-section {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.view-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* CHART WRAPPER */
.chart-wrapper {
    position: relative;
    width: 100%;
    min-height: 240px;
}

/* CRM COLUMNS */
.crm-col {
    min-width: 280px;
    width: 32%;
}

/* PROJECTS */
.project-capacity {
    height: 7px;
}

.project-capacity-bar {
    background: var(--gradient-primary);
}

.project-progress {
    height: 6px;
}

.project-progress-cell {
    width: 22%;
}

/* AGENDA */
.agenda-card {
    margin-bottom: 0.5rem;
    border: 0;
    background: #f8fafc;
    padding: 0.6rem 0.75rem;
}

.focus-card {
    background: #f8fafc;
    border-radius: 10px;
    padding: 0.8rem;
}

/* ajustes específicos da agenda em telas menores */
#view-agenda .table-responsive {
    width: 100%;
}

/* CTA FIXO */
.sticky-cta {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 650px;
    background: #1e1e24;
    color: #fff;
    padding: 10px 15px;
    border-radius: 50px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1050;
    border: 1px solid #444;
    transition: bottom 0.3s;
}

.sticky-cta-check {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: #fff;
    color: #111827;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.sticky-cta-sub {
    font-size: 0.75rem;
}

.cta-btn-pulse {
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 30px;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
    animation: pulse 2s infinite;
    white-space: nowrap;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(211, 35, 226, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(211, 35, 226, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(211, 35, 226, 0);
    }
}

/* RESPONSIVO */

/* Laptops menores */
@media (max-width: 1199.98px) {
    .main-content {
        padding: 1.5rem;
    }
}

/* Até 992px: sidebar escondida e topbar mais compacta */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        padding: 1.25rem;
    }
    .topbar {
        padding: 0 1rem;
        margin: -1.25rem -1.25rem 1.25rem -1.25rem;
    }
    .crm-col {
        width: 80%;
    }

    /* agenda: dá mais respiro e garante scroll horizontal da tabela */
    #view-agenda .card {
        margin-bottom: 1rem;
    }
    #view-agenda .table-responsive {
        overflow-x: auto;
    }
}

/* Tablets e celulares grandes */
@media (max-width: 767.98px) {
    .card {
        margin-bottom: 1rem;
    }
    .chart-wrapper {
        min-height: 220px;
    }
    .sticky-cta {
        max-width: 520px;
        bottom: 15px;
    }
    .cta-btn-pulse {
        font-size: 0.85rem;
    }

    /* agenda: fontes menores e células mais compactas */
    #view-agenda .table thead th,
    #view-agenda .table tbody td {
        white-space: nowrap;
        font-size: 0.78rem;
        padding: 0.45rem 0.6rem;
    }

    .agenda-card {
        padding: 0.55rem 0.7rem;
        font-size: 0.8rem;
    }

    #view-agenda .focus-card h4 {
        font-size: 1.3rem;
    }
}

/* Mobile: CTA só com botão roxo + agenda mais enxuta */
@media (max-width: 575.98px) {
    .login-card {
        padding: 2rem 1.5rem;
    }

    .sticky-cta-info {
        display: none !important;
    }

    .cta-btn-pulse {
        width: 100% !important;
        font-size: 0.9rem;
        padding: 14px;
        border-radius: 40px;
        white-space: normal;
        text-align: center;
    }

    .sticky-cta {
        padding: 12px;
        border-radius: 40px;
        bottom: 12px;
        width: 94%;
        max-width: none;
        justify-content: center !important;
    }

    .crm-col {
        width: 90%;
    }

    .project-progress-cell {
        width: 35%;
    }

    /* agenda: esconde algumas colunas menos críticas para não quebrar tudo
       (ajuste os nth-child conforme o HTML que estiver usando) */

    /* tabela de "próximos compromissos":
       esconde coluna de origem e deixa o resto mais legível no mobile */
    #view-agenda table thead th:nth-child(5),
    #view-agenda table tbody td:nth-child(5) {
        display: none;
    }

    /* se tiver 6ª coluna só com botão/ação, mantém, mas deixa mais compacto */
    #view-agenda table thead th:last-child,
    #view-agenda table tbody td:last-child {
        white-space: nowrap;
    }

    /* deixa os textos do bloco "Hoje" um pouco menores */
    #view-agenda .agenda-card strong.small {
        font-size: 0.78rem;
    }
    #view-agenda .agenda-card p.small {
        font-size: 0.8rem;
    }
}

