/* =====================================================
   ERP Sistema - Estilos personalizados
   ===================================================== */

:root {
    --sidebar-width: 250px;
    --sidebar-collapsed: 80px;
    --sidebar-bg: #1a1d29;
    --sidebar-bg-hover: #252938;
    --sidebar-text: #a0a3b1;
    --sidebar-text-active: #ffffff;
    --topbar-bg: #ffffff;
    --transition: all 0.3s ease;
}

[data-bs-theme="dark"] {
    --topbar-bg: #1a1d29;
}

/* Wrapper */
.wrapper {
    display: flex;
    width: 100%;
}

/* Sidebar */
.sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    transition: var(--transition);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    overflow-y: auto;
}

.sidebar.active {
    margin-left: calc(-1 * var(--sidebar-width));
}

.sidebar-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    max-width: 36px;
    max-height: 36px;
    border-radius: 8px;
}

.sidebar-logo-icon {
    font-size: 28px;
    color: #6c7ee1;
}

.sidebar-company {
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-menu {
    list-style: none;
    padding: 12px 0;
    margin: 0;
}

.sidebar-menu li {
    margin: 2px 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: var(--transition);
    font-size: 14px;
}

.sidebar-menu a:hover {
    background: var(--sidebar-bg-hover);
    color: var(--sidebar-text-active);
}

.sidebar-menu a.active {
    background: rgba(108, 126, 225, 0.15);
    color: var(--sidebar-text-active);
    border-left: 3px solid #6c7ee1;
}

.sidebar-menu a i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

/* Content */
.content {
    width: calc(100% - var(--sidebar-width));
    margin-left: var(--sidebar-width);
    transition: var(--transition);
    min-height: 100vh;
    background: var(--bs-body-bg);
}

.content.active {
    width: 100%;
    margin-left: 0;
}

/* Topbar */
.topbar {
    background: var(--topbar-bg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    padding: 12px 20px;
    position: sticky;
    top: 0;
    z-index: 999;
}

[data-bs-theme="dark"] .topbar {
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Cards do dashboard */
.stat-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-card .stat-value {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}

.stat-card .stat-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
}

/* Login */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1d29 0%, #2d3250 100%);
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    border-radius: 16px;
    border: none;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-logo {
    width: 64px;
    height: 64px;
    background: #6c7ee1;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    margin: 0 auto 16px;
}

/* Tabelas */
.table-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.table > :not(caption) > * > * {
    padding: 0.75rem 1rem;
}

/* Botões */
.btn-primary {
    --bs-btn-bg: #6c7ee1;
    --bs-btn-border-color: #6c7ee1;
    --bs-btn-hover-bg: #5a6dc9;
    --bs-btn-hover-border-color: #5a6dc9;
    --bs-btn-active-bg: #4a5cb0;
    --bs-btn-active-border-color: #4a5cb0;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.4em 0.8em;
}

/* Search */
.search-input {
    border-radius: 8px;
    border: 1px solid var(--bs-border-color);
    padding: 8px 16px;
    font-size: 14px;
    width: 100%;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
}

.search-input:focus {
    outline: none;
    border-color: #6c7ee1;
    box-shadow: 0 0 0 3px rgba(108, 126, 225, 0.15);
}

/* Pix e conta bancária */
.bank-account-card, .pix-key-card {
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
    background: var(--bs-tertiary-bg, #f8f9fa);
}

[data-bs-theme="dark"] .bank-account-card,
[data-bs-theme="dark"] .pix-key-card {
    background: #1e2230;
}

/* Chart container */
.chart-container {
    position: relative;
    height: 250px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
    }
    .sidebar.active {
        margin-left: 0;
    }
    .content {
        width: 100%;
        margin-left: 0;
    }
    .content.active {
        width: 100%;
        margin-left: 0;
    }
}

/* Scrollbar */
.sidebar::-webkit-scrollbar {
    width: 4px;
}
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
}

/* Page title */
.page-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.page-subtitle {
    color: var(--bs-secondary-color);
    font-size: 14px;
    margin-bottom: 20px;
}

/* Filter bar */
.filter-bar {
    background: var(--bs-tertiary-bg, #f8f9fa);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}

[data-bs-theme="dark"] .filter-bar {
    background: #1e2230;
}

/* Required field */
.required::after {
    content: " *";
    color: #dc3545;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--bs-secondary-color);
}
.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}
