/* =========================================================
   Sistema de Comissões — Estilo Global
   ========================================================= */

:root {
    --sidebar-width: 250px;
    --sidebar-bg: #1e1e2e;
    --sidebar-hover: #2a2a3e;
    --sidebar-active: #313154;
    --sidebar-border: rgba(255, 255, 255, 0.07);
    --accent: #6c63ff;
    --accent-light: #8b85ff;
    --text-muted-sidebar: #8b8baa;
    --bg-body: #f5f6fa;
}

/* ===================== Layout ===================== */

body {
    background-color: var(--bg-body);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 0.9rem;
}

#wrapper {
    min-height: 100vh;
}

/* ===================== Sidebar ===================== */

#sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: width 0.25s ease;
}

.sidebar-header {
    padding: 1.4rem 1.2rem;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.sidebar-logo-img {
    width: 100%;
    max-width: 160px;
    background: #fff;
    border-radius: 8px;
    padding: 6px 10px;
}

.sidebar-nav {
    flex: 1;
    padding: 0.8rem 0;
}

.sidebar-section-label {
    padding: 1rem 1.2rem 0.3rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--text-muted-sidebar);
    opacity: 0.6;
}

.sidebar-section-label:first-child {
    padding-top: 0.3rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem 1.2rem;
    color: var(--text-muted-sidebar);
    text-decoration: none;
    font-size: 0.875rem;
    transition: background 0.15s, color 0.15s;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.sidebar-link.active {
    background: var(--sidebar-active);
    color: #fff;
    border-left-color: var(--accent-light);
}

.sidebar-link i {
    font-size: 1rem;
    width: 18px;
    text-align: center;
}

.sidebar-footer {
    padding: 0.8rem 0;
    border-top: 1px solid var(--sidebar-border);
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    padding: 0.6rem 1.2rem 0.4rem;
    color: var(--text-muted-sidebar);
    font-size: 0.82rem;
    gap: 0.5rem;
}

.sidebar-user-info i {
    font-size: 1.3rem;
}

.sidebar-user-name {
    font-weight: 600;
    color: #ccc;
    line-height: 1.2;
}

.sidebar-user-role {
    font-size: 0.75rem;
    color: var(--text-muted-sidebar);
}

.sidebar-logout {
    color: #f87171 !important;
}

.sidebar-logout:hover {
    background: rgba(248, 113, 113, 0.1) !important;
    color: #ff8080 !important;
}

/* ===================== Content ===================== */

#content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    flex: 1;
}

/* ===================== Page header ===================== */

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a2e;
}

/* ===================== Stat cards ===================== */

.stat-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.07);
}

.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-label {
    font-size: 0.65rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.stat-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.1;
}

/* ===================== Seller cards ===================== */

.seller-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.07);
    overflow: hidden;
}

.seller-card-header {
    background: #fff;
    border-bottom: 1px solid #f0f0f5;
    padding: 0.9rem 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.seller-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: #1a1a2e;
}

.total-label {
    font-size: 0.7rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.total-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #16a34a;
}

/* ===================== Badges ===================== */

.type-badge {
    display: inline-block;
    padding: 0.2em 0.65em;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.type-interno {
    background: #dbeafe;
    color: #1d4ed8;
}

.type-externo {
    background: #ede9fe;
    color: #6d28d9;
}

.contract-badge {
    display: inline-block;
    padding: 0.2em 0.6em;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
}

.contract-novo {
    background: #dcfce7;
    color: #15803d;
}

.contract-renovacao {
    background: #fef9c3;
    color: #a16207;
}

.contract-troca_titularidade, .contract-troca {
    background: #ede9fe;
    color: #6d28d9;
}

.contract-sem_comissao, .contract-sem {
    background: #f3f4f6;
    color: #6b7280;
}

.contract-eventos, .contract-venda_materiais {
    background: #ffe4e6;
    color: #be123c;
}

.goal-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2em 0.7em;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.goal-yes {
    background: #dcfce7;
    color: #15803d;
}

.goal-no {
    background: #f3f4f6;
    color: #6b7280;
}

/* ===================== Period select ===================== */

.period-select {
    min-width: 160px;
}

/* ===================== Empty state ===================== */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1rem;
    color: #bbb;
    gap: 0.4rem;
    font-size: 0.875rem;
}

.empty-state i {
    font-size: 2rem;
    opacity: 0.4;
}

/* ===================== Login ===================== */

.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #1e1e2e 0%, #313154 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 400px;
    border: none;
    border-radius: 16px;
}

.login-icon {
    font-size: 2.8rem;
    color: var(--accent-light);
    line-height: 1;
}

/* ===================== Tables ===================== */

.table > thead > tr > th {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #888;
    border-bottom-width: 1px;
}

.table > tbody > tr > td {
    vertical-align: middle;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
}

.table > tfoot > tr > td {
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
}

/* ===================== Forms ===================== */

.form-label {
    font-size: 0.85rem;
}

.form-control, .form-select {
    font-size: 0.875rem;
    border-radius: 8px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 0.2rem rgba(108, 99, 255, 0.2);
}

.btn {
    border-radius: 8px;
    font-size: 0.875rem;
}

.btn-primary {
    background-color: var(--accent);
    border-color: var(--accent);
}

.btn-primary:hover {
    background-color: #5a51ee;
    border-color: #5a51ee;
}

/* ===================== Funil de Vendas ===================== */

.funil-board {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.funil-column {
    flex: 1 1 0;
    min-width: 240px;
    background: #f7f7fb;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 220px);
}

.funil-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    font-weight: 700;
    font-size: 0.85rem;
    color: #1a1a2e;
    border-bottom: 1px solid #e5e5f0;
}

.funil-column-count {
    background: #e5e5f0;
    color: #555;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.1em 0.6em;
}

.funil-column-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    transition: background-color 0.15s;
}

.funil-column-over {
    background-color: #ecebfd;
    border-radius: 8px;
}

.funil-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.07);
    padding: 0.7rem 0.8rem;
    cursor: grab;
}

.funil-card.dragging {
    opacity: 0.4;
}

.funil-card-client {
    font-weight: 700;
    font-size: 0.85rem;
    color: #1a1a2e;
}

.funil-card-seller,
.funil-card-product {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.15rem;
}

.funil-card-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: #16a34a;
    margin-top: 0.25rem;
}

.funil-card-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.5rem;
    padding-top: 0.4rem;
    border-top: 1px solid #f0f0f5;
}

.funil-card-actions a {
    color: #6b7280;
    font-size: 0.9rem;
}

/* ===================== Print ===================== */

@media print {
    .no-print,
    #sidebar,
    .btn,
    .alert,
    nav {
        display: none !important;
    }

    #content {
        margin-left: 0 !important;
    }

    .print-only {
        display: block !important;
    }

    .seller-card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        break-inside: avoid;
    }

    body {
        background: white;
    }
}

.print-only {
    display: none;
}
