/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

/* Layout wrapper */
.wrapper {
    display: flex;
    width: 100%;
    height: 100vh;
}

/* Sidebar styles */
.sidebar {
    width: 260px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transition: all 0.3s;
    position: fixed;
    height: 100vh;
    z-index: 999;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.sidebar.active {
    margin-left: -260px;
}

.sidebar-content {
    padding: 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-brand {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    height: 64px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.brand-logo {
    display: flex;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
}

.brand-logo i {
    margin-right: 10px;
    color: #ffffff;
}

/* Sidebar menu */
.sidebar-menu {
    padding: 20px 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-menu .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    text-decoration: none;
    border-radius: 0;
    transition: all 0.3s;
    border: none;
    background: none;
}

.sidebar-menu .nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    transform: translateX(5px);
}

.sidebar-menu .nav-link.active {
    background: rgba(255,255,255,0.2);
    color: white;
    border-left: 4px solid #ffffff;
}

.sidebar-menu .nav-link i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.sidebar-menu .nav-link span {
    font-size: 14px;
}

/* Submenu styles */
.sidebar-menu .collapse .nav-link {
    padding-left: 50px;
    font-size: 13px;
    background: rgba(0,0,0,0.1);
}

.sidebar-menu .collapse .nav-link:hover {
    background: rgba(255,255,255,0.05);
}

/* Scrollbar customization for sidebar */
.sidebar-content::-webkit-scrollbar,
.sidebar-menu::-webkit-scrollbar {
    width: 6px;
}

.sidebar-content::-webkit-scrollbar-track,
.sidebar-menu::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}

.sidebar-content::-webkit-scrollbar-thumb,
.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
    transition: background 0.3s ease;
}

.sidebar-content::-webkit-scrollbar-thumb:hover,
.sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

/* Firefox scrollbar */
.sidebar-content,
.sidebar-menu {
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) rgba(255,255,255,0.1);
}

/* Main content */
.content {
    margin-left: 260px;
    width: calc(100% - 260px);
    min-height: 100vh;
    transition: all 0.3s;
}

.content.active {
    margin-left: 0;
    width: 100%;
}

/* Header styles */
.navbar {
    background: white !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-bottom: 1px solid #e9ecef !important;
    height: 64px;
    min-height: 64px;
    padding: 0;
    display: flex;
    align-items: center;
}

.navbar .container-fluid {
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
}

.navbar-text {
    margin-bottom: 0;
    font-size: 14px;
}

#sidebarCollapse {
    background: white;
    border: 1px solid #ddd;
    color: #666;
    padding: 0;
    height: 36px;
    width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

#sidebarCollapse:hover {
    background: #f8f9fa;
}

/* Cards and widgets */
.card {
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 15px;
    border: 1px solid #e9ecef;
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px 8px 0 0 !important;
    border: none;
    padding: 12px 20px;
}

/* KPI Cards */
.kpi-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #e9ecef;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.kpi-card.revenue {
    border-left: 3px solid #28a745;
}

.kpi-card.expenses {
    border-left: 3px solid #dc3545;
}

.kpi-card.profit {
    border-left: 3px solid #17a2b8;
}

.kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 5px;
    line-height: 1.2;
}

.kpi-label {
    color: #6c757d;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 8px;
}

.kpi-change {
    font-size: 0.75rem;
    margin-top: 4px;
    font-weight: 500;
}

.kpi-change.positive {
    color: #28a745;
}

.kpi-change.negative {
    color: #dc3545;
}

.kpi-icon {
    opacity: 0.7;
    font-size: 1.5rem;
    min-width: 40px;
    text-align: center;
}

/* Charts */
.chart-container {
    position: relative;
    width: 100% !important;
    height: 350px;
    margin: 15px 0;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.chart-container-small {
    position: relative;
    height: 280px;
    margin: 10px 0;
}

/* Tables */
.table {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.table th {
    background: #f8f9fa;
    border: none;
    font-weight: 600;
    color: #495057;
}

.table td {
    border: none;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
    border: none;
}

/* Forms */
.form-control {
    border-radius: 5px;
    border: 1px solid #ddd;
    padding: 10px 15px;
    transition: all 0.3s;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Login page */
.login-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo i {
    font-size: 48px;
    color: #667eea;
    margin-bottom: 10px;
}

.login-title {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-weight: 600;
}

/* Responsive design */
@media (max-width: 768px) {
    .sidebar {
        margin-left: -260px;
    }
    
    .sidebar.active {
        margin-left: 0;
    }
    
    .content {
        margin-left: 0;
        width: 100%;
    }
    
    .content.active {
        margin-left: 0;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

/* Utility classes */
.text-revenue {
    color: #28a745;
}

.text-expenses {
    color: #dc3545;
}

.text-profit {
    color: #17a2b8;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.bg-gradient-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.bg-gradient-danger {
    background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
}

/* Page title */
.page-title {
    color: #333;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #667eea;
    display: inline-block;
}

/* Main content improvements */
.container-fluid {
    padding: 15px 20px !important;
}

/* Table improvements */
.table-sm th,
.table-sm td {
    padding: 8px;
    font-size: 0.875rem;
}

/* Progress bars */
.progress {
    border-radius: 10px;
    overflow: hidden;
}

/* Alerts */
.alert {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
}

/* Badges */
.badge {
    font-size: 0.75rem;
    padding: 4px 8px;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .kpi-value {
        font-size: 1.5rem;
    }
    
    .kpi-label {
        font-size: 0.7rem;
    }
    
    .kpi-card {
        padding: 12px;
    }
    
    .container-fluid {
        padding: 15px !important;
    }
}

/* Global Search Styles */
#globalSearch {
    border-radius: 18px 0 0 18px;
    padding-left: 16px;
    border: 1px solid #ddd;
    border-right: none;
    transition: all 0.3s ease;
    height: 36px;
    font-size: 14px;
}

#globalSearch:focus {
    border-color: #667eea;
    box-shadow: none;
    outline: none;
}

#globalSearchForm .input-group {
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    height: 36px;
}

#globalSearchForm .input-group:focus-within {
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
}

#globalSearchForm .btn-outline-primary {
    border-radius: 0 18px 18px 0;
    border-left: none;
    background: transparent;
    border-color: #ddd;
    color: #6c757d;
    transition: all 0.3s ease;
    height: 36px;
    width: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

#globalSearchForm .btn-outline-primary:hover {
    background: transparent;
    border-color: #667eea;
    color: #667eea;
    box-shadow: none;
}

#globalSearchForm .btn-outline-primary:focus {
    background: transparent;
    border-color: #667eea;
    color: #667eea;
    box-shadow: none;
    outline: none;
}

#globalSearchForm .btn-outline-primary:active {
    background: rgba(102, 126, 234, 0.1) !important;
    border-color: #667eea !important;
    color: #667eea !important;
    box-shadow: none !important;
}

#globalSearchForm .btn-outline-primary i {
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

#globalSearchForm .btn-outline-primary:hover i {
    opacity: 1;
}

/* Remover bordas internas do input-group */
#globalSearchForm .input-group .form-control:focus {
    border-right: none;
    z-index: 3;
}

#globalSearchForm .input-group .btn:focus {
    z-index: 3;
}

/* Search Results */
.search-result-item {
    transition: all 0.2s ease;
    cursor: pointer;
}

.search-result-item:hover {
    transform: translateX(5px);
}

/* Media queries adicionais para busca */
@media (max-width: 768px) {
    #globalSearchForm {
        width: 250px !important;
    }
    
    #globalSearchForm .input-group {
        width: 100% !important;
    }
    
    .navbar-text {
        display: none;
    }
}

@media (max-width: 576px) {
    #globalSearchForm {
        width: 200px !important;
    }
    
    #globalSearch {
        font-size: 14px;
        padding-left: 15px;
    }
}

/* Dropdown menu styles */
.dropdown-menu {
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 8px;
    padding: 8px 0;
    min-width: 180px;
    margin-top: 8px;
}

.dropdown-item {
    padding: 8px 16px;
    font-size: 14px;
    color: #495057;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.dropdown-item i {
    margin-right: 8px;
    width: 16px;
    text-align: center;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.dropdown-divider {
    margin: 8px 0;
    border-color: #e9ecef;
}

/* Prevent horizontal scroll */
.navbar-nav {
    overflow: visible;
}

.dropdown-menu-end {
    right: 0;
    left: auto;
}

#rh-menu .nav-link {
    font-size: 14px;
}

#rh-menu .nav-link i {
    font-size: 14px;
    margin-right: 8px;
}

#rh-menu .nav-link span {
    font-size: 14px;
}

#filtro-filial,
#filtro-grupo-filial,
#filtro-periodo,
#filtro-data-inicio,
#filtro-data-fim {
    height: 38px;
    padding: 6px 12px;
    font-size: 1rem;
    border-radius: 4px;
    border: 1px solid #ccc;
    box-sizing: border-box;
    display: inline-block;
    vertical-align: middle;
}

.d-flex.align-items-center.flex-wrap.gap-2 > * {
    margin-bottom: 0 !important;
    margin-top: 0 !important;
    align-self: center !important;
}

input[type=number].form-control {
    height: 38px !important;
    padding: 6px 12px !important;
}

#btnBuscar {
    height: 38px !important;
    padding: 6px 16px !important;
} 