/* ============================================================
   MuviToys — CSS Principal
   ============================================================ */

:root {
    --primary:       #534AB7;
    --primary-light: #EEEDFE;
    --teal:          #1D9E75;
    --teal-light:    #E1F5EE;
    --amber:         #BA7517;
    --amber-light:   #FAEEDA;
    --danger:        #A32D2D;
    --danger-light:  #FCEBEB;
    --sidebar-w:     240px;
    --header-h:      56px;
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    margin: 0;
}

/* ── Sidebar ── */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: #fff;
    border-right: 1px solid rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.25s ease;
}

.sidebar-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 32px; height: 32px;
    background: var(--primary);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 18px;
    flex-shrink: 0;
}

.logo-icon-sm {
    width: 28px; height: 28px;
    background: var(--primary);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 15px;
}

.logo-title { font-size: 15px; font-weight: 600; color: #1a1a1a; }
.logo-sub   { font-size: 11px; color: #aaa; }

.sidebar-menu {
    flex: 1;
    padding: 1rem 0.75rem;
    overflow-y: auto;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    color: #666;
    text-decoration: none;
    margin-bottom: 4px;
    transition: background 0.15s, color 0.15s;
}

.sidebar-item i { font-size: 18px; flex-shrink: 0; }
.sidebar-item:hover { background: #f5f5f5; color: #1a1a1a; }
.sidebar-item.active { background: var(--primary-light); color: var(--primary); font-weight: 500; }
.sidebar-item.active i { color: var(--primary); }

.sidebar-footer {
    padding: 1rem;
    font-size: 11px;
    color: #ccc;
    border-top: 1px solid rgba(0,0,0,0.06);
}

/* ── Main content ── */
.main-content {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
}

.content-area {
    padding: 2rem;
}

/* ── Mobile header ── */
.mobile-header {
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    padding: 0 1rem;
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.btn-menu {
    background: none;
    border: none;
    font-size: 22px;
    color: #666;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.mobile-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
}

/* Overlay mobile */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 999;
    display: none;
}
.sidebar-overlay.show { display: block; }

/* ── Responsivo ── */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .content-area {
        padding: 1rem;
    }
}

/* ── Cards ── */
.card { border: 1px solid rgba(0,0,0,0.08); border-radius: 12px; }
.card-header { background: #fff; border-bottom: 1px solid rgba(0,0,0,0.06); border-radius: 12px 12px 0 0 !important; padding: 1rem 1.25rem; }
.card-body { padding: 1.25rem; }

/* ── Badges ── */
.badge-ativo    { background: #EAF3DE; color: #3B6D11; }
.badge-inativo  { background: #F1EFE8; color: #5F5E5A; }
.badge-avista   { background: var(--teal-light); color: #085041; }
.badge-prazo    { background: var(--amber-light); color: #633806; }
.badge-pago     { background: #EAF3DE; color: #3B6D11; }
.badge-pendente { background: var(--amber-light); color: #633806; }
.badge-atrasada { background: var(--danger-light); color: var(--danger); }
.badge-primeira { background: var(--primary-light); color: #3C3489; }

/* ── Botões ── */
.btn-primary   { background: var(--primary) !important; border-color: var(--primary) !important; }
.btn-primary:hover { background: #4238a0 !important; }
.btn-teal      { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-teal:hover { background: #178a64; color: #fff; }
.btn-amber     { background: var(--amber); border-color: var(--amber); color: #fff; }
.btn-amber:hover { background: #9e6312; color: #fff; }

/* ── Tabela ── */
.table-hover tbody tr:hover { background: #f9f9f9; cursor: pointer; }
.table th { font-size: 12px; font-weight: 600; color: #888; text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 2px solid rgba(0,0,0,0.08); }

/* ── Foto produto ── */
.produto-thumb {
    width: 44px; height: 44px;
    border-radius: 8px;
    object-fit: cover;
}
.produto-thumb-placeholder {
    width: 44px; height: 44px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
}
.cat-brinquedo { background: var(--primary-light); }
.cat-doce      { background: var(--amber-light); }

/* ── Dashboard stats ── */
.stat-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.08);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 14px;
}
.stat-icon {
    width: 48px; height: 48px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.stat-label { font-size: 12px; color: #888; margin-bottom: 2px; }
.stat-value { font-size: 20px; font-weight: 600; }

/* ── Urgência visitas ── */
.urgency-box {
    border-radius: 10px;
    padding: 14px;
    text-align: center;
}
.urgency-num   { font-size: 28px; font-weight: 700; }
.urgency-label { font-size: 12px; margin-top: 2px; }

/* ── Cobrança card ── */
.cob-border-atrasada { border-left: 4px solid #E24B4A !important; }
.cob-border-vencendo { border-left: 4px solid #EF9F27 !important; }
.cob-border-pendente { border-left: 4px solid #378ADD !important; }
.cob-border-paga     { border-left: 4px solid var(--teal) !important; }

/* ── Modal ── */
.modal-header { border-bottom: 1px solid rgba(0,0,0,0.08); }
.modal-footer { border-top: 1px solid rgba(0,0,0,0.08); }

/* ── Loading ── */
.spinner-overlay {
    position: fixed; inset: 0;
    background: rgba(255,255,255,0.7);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
}

/* ── Toast ── */
.toast-container { z-index: 9999; }

/* ── PIX ── */
.pix-qr {
    width: 200px; height: 200px;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.1);
}
