/* ===============================
/* ===============================
   VARIÁVEIS DE COR (ContOn)
================================ */
:root {
    --primary: #0ea5e9;      /* azul ContOn */
    --primary-dark: #0284c7;
    --sidebar-bg: linear-gradient(180deg, #0284c7, #0ea5e9);
    --sidebar-text: #e0f2fe;
    --sidebar-hover: rgba(255,255,255,.12);
    --content-bg: #f8fafc;
}

/* ===============================
   CSS GERAL
================================ */
body {
    margin: 0;
    background: var(--content-bg);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.td-dropdown {
    z-index: 2000 !important;
}

.table td {
    padding: 0.4rem 0.75rem;
}
.table td {
    padding: 0.2rem 0.75rem;
}

.btn {
    transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.btn:hover {
    box-shadow: 0 4px 12px rgb(0 123 255 / 0.3);
}

.btn:active {
    transform: scale(0.98);
}

.breadcrumb-item {
    font-size: 14px;
}
.breadcrumb-item a {
    font-size: 14px;
    color: var(--primary) !important;
    font-weight: 600;
    text-decoration: none;
}

.breadcrumb-item.active {
    color: #2f2f2f;
    font-weight: 700;
    text-decoration: none;
}

#valor_total{
    background-color: #f8f9fa;
    font-weight: 600;
}

.pe-none {
    pointer-events: none;
}

/* ===============================
   SIDEBAR
================================ */
#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 220px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    transition: width .25s ease;
    z-index: 1000;
}

#sidebar.collapsed {
    width: 70px;
}

/* LOGO */
.sidebar-logo {
    height: 64px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 18px;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,.15);
}

/* regra base (mantém seu padrão) */
.sidebar-logo img {
    height: 36px;
}

/* estado normal (sidebar aberta) */
.sidebar-logo .logo-full {
    display: block;
}

.sidebar-logo .logo-icon {
    display: none;
}

.sidebar-logo span {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    transition: opacity .2s;
}

/* ===== SIDEBAR RECOLHIDA ===== */
#sidebar.collapsed .logo-full,
#sidebar.collapsed span {
    display: none;
}

#sidebar.collapsed .logo-icon {
    display: block;
}

/* centraliza quando recolhida */
#sidebar.collapsed .sidebar-logo {
    justify-content: center;
    padding: 0;
}

/* ===============================
   SIDEBAR COLLAPSED - CENTRALIZAR ÍCONES
================================ */

#sidebar.collapsed .sidebar-menu .menu-item > a {
    justify-content: center;   /* centraliza horizontal */
    padding: 12px 0;           /* remove padding lateral */
}

#sidebar.collapsed .sidebar-menu .menu-item > a i:first-child {
    margin: 0;
    width: auto;
}

/* esconder texto */
#sidebar.collapsed .sidebar-menu .menu-item > a span {
    display: none;
}

/* esconder seta */
#sidebar.collapsed .sidebar-menu .menu-item > a .arrow {
    display: none;
}

#sidebar.collapsed .menu-item {
    display: flex;
}

#sidebar.collapsed .menu-item > a {
    width: 100%;
}

/* LINKS PRINCIPAIS */
.sidebar-menu .menu-item > a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    color: var(--sidebar-text);
    text-decoration: none;
}

/* ÍCONE */
.sidebar-menu .menu-item > a i:first-child {
    width: 20px;
    text-align: center;
}

/* TEXTO */
.sidebar-menu .menu-item > a span {
    flex: 1; /* empurra a seta pro final */
    white-space: nowrap;
}

/* SETA */
.sidebar-menu .menu-item > a .arrow {
    margin-left: auto;
    font-size: 12px;
    transition: transform .2s ease;
}

.menu-item > a[aria-expanded="true"] .arrow {
    transform: rotate(180deg);
}

/* Tooltip quando recolhido */
.sidebar-tooltip {
    position: fixed;
    background: #1f2d3d;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease;
    z-index: 99999;
}

/* MENU */
.sidebar-menu {
    list-style: none;
    padding: 12px 0;
    margin: 0;
    overflow-y: auto;
}

.menu-item > a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
    transition: background .2s;
}

.menu-item > a:hover {
    background: var(--sidebar-hover);
}

.menu-item i {
    width: 20px;
    text-align: center;
    font-size: 15px;
}

.menu-item span {
    white-space: nowrap;
}

#sidebar.collapsed .menu-item span,
#sidebar.collapsed .menu-item .arrow {
    display: none;
}

.sidebar-quick {
    display: flex;
    justify-content: space-around;
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,.2);
}

.sidebar-quick a {
    color: #e0f2fe;
    font-size: 18px;
}

/* SUBMENU */
.submenu {
    list-style: none;
    padding-left: 50px;
}

.submenu a {
    display: block;
    padding: 6px 0;
    font-size: 14px;
    color: #e0f2fe;
    text-decoration: none;
}

.submenu a:hover {
    text-decoration: underline;
}

/* ===============================
   TOPBAR
================================ */
.topbar {
    position: fixed;
    top: 0;
    left: 220px;
    width: calc(100% - 220px);
    height: 64px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    transition: left .25s ease, width .25s ease;
    z-index: 900;
}

/* Sidebar recolhida */
body.sidebar-collapsed .topbar {
    left: 70px;
    width: calc(100% - 70px);
}

/* BOTÃO TOGGLE */
#toggleSidebar {
    border: none;
    background: transparent;
    font-size: 18px;
}

/* LINKS TOPO */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

/* ===============================
   LINKS TOPO - PILLS
================================ */

.top-pill {
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: all .2s ease;
}

/* WhatsApp */
.top-pill.whatsapp {
    background: rgba(34, 197, 94, 0.12);
    color: #16a34a;
}

.top-pill.whatsapp:hover {
    background: rgba(34, 197, 94, 0.22);
}

/* Suporte */
.top-pill.suporte {
    background: rgba(37, 99, 235, 0.12);
    color: #2563eb;
}

.top-pill.suporte:hover {
    background: rgba(37, 99, 235, 0.22);
}

/* Micro-interação */
.top-pill:hover {
    transform: translateY(-1px);
}

/* ===============================
   USUÁRIO - PILL
================================ */

.user-pill {
    padding: 3px 10px 8px 4px;
    border-radius: 999px;
    background: #f1f5f9;
    transition: background .2s ease, box-shadow .2s ease;
}

.user-pill:hover {
    background: #e5e7eb;
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
    cursor: pointer;
}

/* Avatar */
.user-pill img {
    width: 26px;
    height: 26px;
    border-radius: 50%;
}

/* Nome */
.user-name {
    font-weight: 500;
    color: #1f2937;
    white-space: nowrap;
}

.dropdown a {
    text-decoration: none;
}

.user-name a:hover {
    text-decoration: underline;
}

/* Caret mais sutil */
.user-pill.dropdown-toggle::after {
    margin-left: 6px;
    font-size: 12px;
    opacity: .6;
}

/* ===============================
   DROPDOWN PERFIL
================================ */

.profile-dropdown {
    width: 240px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,.15);
    border: none;
}

/* Header azul */
.profile-header {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    padding: 18px 16px;
    color: #fff;
}

/* Avatar grande */
.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,.6);
    margin-bottom: 8px;
}

/* Nome */
.profile-name {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
}

/* Área de ações */
.profile-actions {
    padding: 14px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

/* ===============================
   ÁREA DE CONTEÚDO
================================ */
.main-content {
    margin-top: 64px;
    margin-left: 220px;
    transition: margin-left .25s ease;
}

body.sidebar-collapsed .main-content {
    margin-left: 70px;
}

/* Links Rápidos */
a {
    font-size: 13px;
}

.card-body .links-rapidos {
    padding: 10px 5px;
}

/* Notificações */

.nav-item .nav-link {
    font-size: 13px;
    font-weight: 600;
    color: #000;
}

.nav-tabs-custom .nav-item .nav-link.active {
    color: var(--primary) !important;
}

.nav-item .nav-link span {
    font-size: 13px;
}

/* Cabeçalho da tabela */
.table-modern thead th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6c757d;
    border-bottom: 1px solid #dee2e6;
}

.table-modern tbody tr {
    font-size: 13px;
}

/* Hover da linha */
.table-modern tbody tr:hover {
    background-color: #f8f9fa;
}

@keyframes fadeSlideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estados visuais da linha (para JS) */
.tr-loading { opacity: .5; }
.tr-success { background-color: #e9f7ef !important; }
.tr-error   { background-color: #fdecea !important; }

.btn-acoes {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropdown-menu {
    min-width: 220px;
    padding: 8px 0;
    border-radius: 12px;
    border: 0;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 400;
    transition: all 0.15s ease;
}

.dropdown-item i {
    width: 18px;
    text-align: center;
    font-size: 14px;
}

.dropdown-item button {
    all: unset;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.dropdown-menu {
    border: 0;
    border-radius: 14px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

.dropdown-divider {
    margin: 4px 0;
}

.dropdown-item:hover {
    background: #f1f5f9;
    transform: translateX(3px);
}

/* ===============================
   RESPONSIVO
================================ */
@media (max-width: 992px) {

    /* Sidebar vira overlay */
    #sidebar {
        position: fixed;
        top: 64px; /* abaixo da topbar */
        left: 0;
        width: 100%;
        height: calc(100vh - 64px);
        transform: translateY(-100%);
        transition: transform .3s ease;
        z-index: 2000;
    }

    #sidebar.mobile-open {
        transform: translateY(0);
    }

    /* Não mexe no layout */
    .topbar {
        left: 0 !important;
        width: 100% !important;
    }

    .main-content {
        margin-left: 0 !important;
    }

    /* No mobile nunca usa modo collapsed */
    #sidebar.collapsed {
        width: 100%;
    }
}

/*Página Recebimentos */
.bootstrap-select .dropdown-toggle {
    border: 1px solid #ced4da !important;
    background-color: #fff !important;
    height: calc(2.25rem + 2px);
    padding: .375rem .75rem;
    border-radius: .375rem;
}

.bootstrap-select .dropdown-toggle:focus {
    box-shadow: 0 0 0 .25rem rgba(13,110,253,.25);
}

.bootstrap-select .dropdown-menu {
    border-radius: .375rem;
}

/* Botões e total acima dos datatables*/
.dt-buttons{
    display:flex !important;
    align-items:center;
    width:100%;
    margin-bottom: 20px;
}

.dt-buttons .btn {
    margin:0 !important;
    border-radius:0 !important;
}

.resumo-recebimentos{
    margin-left:auto;
    text-align:right;
    background:#fff;
    padding:12px 18px;
    border-radius:12px;
    border:1px solid #e9ecef;
    box-shadow:0 2px 10px rgba(0,0,0,.03);
}

.valor-total{
    font-size:34px;
    font-weight:700;
    color:#198754;
    line-height:1;
}

.qtd-recebimentos{
    margin-top:5px;
    font-size:13px;
    color:#6c757d;
}

#total_recebimentos, #total_pagamentos {
    margin-left:auto;
}

/* Página novo Recebimento */
.form-switch .form-check-input {
    width: 3rem;
    height: 1.6rem;
    cursor: pointer;
}

.form-switch .form-check-input:checked {
    background-color: #198754;
    border-color: #198754;
    height: 1.6rem;
}

/* Página Tarefas */

.visualizar,
.form-edicao {
    overflow: hidden;
    transition:
    max-height .15s linear,
    opacity .15s linear;
}

.slide-hide {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
}

.slide-show {
    max-height: auto;
    opacity: 1;
    overflow: hidden;
}