/* SG4 ERP - Custom Styles */

:root {
    --sidebar-width: 260px;
    --sidebar-bg: #1a1f2e;
    --sidebar-text: #c8cdd8;
    --sidebar-hover: rgba(255,255,255,0.08);
    --sidebar-active: #3b82f6;
    --topbar-height: 56px;
}

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

/* =========== SIDEBAR =========== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--sidebar-bg);
    z-index: 1040;
    overflow-y: auto;
    overflow-x: hidden;
    transition: all 0.3s ease;
    box-shadow: 2px 0 10px rgba(0,0,0,0.3);
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 18px 20px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    letter-spacing: 1px;
    background: rgba(59,130,246,0.15);
}

.sidebar-nav {
    list-style: none;
    padding: 10px 0;
    margin: 0;
}

.sidebar-section {
    padding: 14px 20px 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.35);
}

.sidebar-item {
    margin: 1px 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
    gap: 12px;
    font-size: 0.88rem;
}

.sidebar-link:hover {
    background-color: var(--sidebar-hover);
    color: #fff;
}

.sidebar-link.active {
    background-color: var(--sidebar-active);
    color: #fff;
    font-weight: 600;
}

.sidebar-link.active i {
    color: #fff !important;
}

.sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
}

/* =========== NAVBAR =========== */
.navbar {
    right: 0;
    height: var(--topbar-height);
    border-bottom: 1px solid #e9ecef;
}

/* =========== MAIN CONTENT =========== */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
    padding: 24px;
    min-height: calc(100vh - var(--topbar-height));
}

/* =========== CARDS =========== */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

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

/* Stat Cards */
.stat-card {
    border-left: 4px solid transparent;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.stat-card.stat-danger  { border-left-color: #dc3545; }
.stat-card.stat-success { border-left-color: #198754; }
.stat-card.stat-warning { border-left-color: #fd7e14; }
.stat-card.stat-info    { border-left-color: #0dcaf0; }
.stat-card.stat-primary { border-left-color: #3b82f6; }

.stat-card .stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.stat-icon.icon-danger  { background: rgba(220,53,69,0.1);   color: #dc3545; }
.stat-icon.icon-success { background: rgba(25,135,84,0.1);   color: #198754; }
.stat-icon.icon-warning { background: rgba(253,126,20,0.1);  color: #fd7e14; }
.stat-icon.icon-info    { background: rgba(13,202,240,0.1);  color: #0dcaf0; }
.stat-icon.icon-primary { background: rgba(59,130,246,0.1);  color: #3b82f6; }

.stat-card .stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =========== TABLES =========== */
.table-hover tbody tr:hover {
    background-color: rgba(59,130,246,0.04);
}

.table thead th {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    border-bottom: 2px solid #dee2e6;
}

/* Row highlighting */
tr.row-vencido {
    background-color: rgba(220, 53, 69, 0.06) !important;
}

tr.row-vencendo {
    background-color: rgba(255, 193, 7, 0.10) !important;
}

/* =========== BADGES =========== */
.badge {
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
}

/* =========== BUTTONS =========== */
.btn-sm {
    font-size: 0.78rem;
}

/* =========== FORMS =========== */
.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #374151;
}

.form-control:focus,
.form-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 0.2rem rgba(59,130,246,0.15);
}

/* =========== BREADCRUMB =========== */
.breadcrumb {
    background: transparent;
    padding: 0;
    font-size: 0.82rem;
}

/* =========== VALUE COLORS =========== */
.text-entrada { color: #198754; font-weight: 600; }
.text-saida   { color: #dc3545; font-weight: 600; }

/* =========== RESPONSIVE =========== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        padding: 16px;
    }
    .navbar {
        left: 0 !important;
    }
    .stat-card .stat-value {
        font-size: 1.1rem;
    }
}
