body {
    background-color: #f5f6fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ── Sidebar layout ──────────────────────────────────────────── */
#sidebar {
    width: 220px;
    min-height: 100vh;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    background: #1a2535;
    display: flex;
    flex-direction: column;
    z-index: 200;
    overflow-y: auto;
}

#main-content {
    margin-left: 220px;
    min-height: 100vh;
    background: #f5f6fa;
}

.sidebar-brand {
    padding: 18px 16px 14px;
    border-bottom: 1px solid rgba(255,255,255,.07);
    flex-shrink: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 10px 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 12px;
    border-radius: 7px;
    color: rgba(255,255,255,.62);
    text-decoration: none;
    font-size: .845rem;
    margin-bottom: 1px;
    transition: background .12s, color .12s;
}

.sidebar-link:hover {
    background: rgba(255,255,255,.07);
    color: #fff;
}

.sidebar-link.active {
    background: rgba(13,110,253,.28);
    color: #fff;
    font-weight: 600;
}

.sidebar-link .bi {
    font-size: .95rem;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 12px 16px 16px;
    border-top: 1px solid rgba(255,255,255,.07);
    flex-shrink: 0;
}

@media (max-width: 768px) {
    #sidebar  { transform: translateX(-100%); transition: transform .2s; }
    #sidebar.open { transform: translateX(0); }
    #main-content { margin-left: 0; }
}

.navbar-brand {
    letter-spacing: 0.5px;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-stat {
    border-radius: 12px;
    transition: transform 0.15s;
}

.card-stat:hover {
    transform: translateY(-2px);
}

.card {
    border-radius: 12px;
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
}

.table thead th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    font-weight: 600;
    border-top: none;
}

.badge-parcela {
    font-size: 0.7rem;
    background-color: #e9ecef;
    color: #495057;
    border-radius: 20px;
    padding: 2px 8px;
}

.sidebar-link {
    border-radius: 8px;
    margin-bottom: 2px;
    transition: background-color 0.15s;
}

.sidebar-link:hover,
.sidebar-link.active {
    background-color: rgba(255,255,255,0.15);
}

.presenca-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.presenca-dia {
    aspect-ratio: 1;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.15s;
}

.presenca-dia.presente {
    background-color: #d1fae5;
    color: #065f46;
    border-color: #6ee7b7;
}

.presenca-dia.ausente {
    background-color: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

.presenca-dia.vazio {
    background-color: transparent;
    cursor: default;
}

.presenca-dia:not(.vazio):hover {
    opacity: 0.8;
    transform: scale(1.08);
}

.valor-positivo { color: #059669; font-weight: 600; }
.valor-negativo { color: #dc2626; font-weight: 600; }

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

.table-hover tbody tr:hover {
    background-color: rgba(13,110,253,0.04);
}

.imposto-row td:first-child { font-weight: 500; }

@media (max-width: 768px) {
    .presenca-grid { grid-template-columns: repeat(7, 1fr); }
    .presenca-dia { font-size: 0.65rem; }
}

/* Sidebar submenu */
.sidebar-group-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,.65);
    text-align: left;
    font-size: .875rem;
}
.sidebar-group-btn:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar-submenu { padding-left: 8px; }
.sidebar-sublink { font-size: .82rem; padding: 6px 12px; color: rgba(255,255,255,.55); }
.sidebar-sublink:hover { color: #fff; }
.sidebar-sublink.active { background: rgba(13,110,253,.28); color: #fff; font-weight: 600; }
.sidebar-chevron { font-size: .7rem; transition: transform .2s; }
.sidebar-chevron.rotated { transform: rotate(180deg); }
.sidebar-group-btn[aria-expanded="true"] .sidebar-chevron { transform: rotate(180deg); }
