/* ============================================================================
   Workbotics ERP - Garment Production Management System (GPMS)
   Custom CSS overrides layered on top of Bootstrap 5 and the SB Admin 2 shim.
   ============================================================================ */

:root {
    --gpms-primary: #4e73df;
    --gpms-primary-dark: #224abe;
    --gpms-sidebar-width: 14rem;
}

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8f9fc;
}

/* ---------- Sidebar ---------- */
.sidebar {
    width: var(--gpms-sidebar-width);
    min-height: 100vh;
}
.sidebar .nav-item .nav-link {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
    padding: 0.85rem 1rem;
}
.sidebar .nav-item .nav-link:hover,
.sidebar .nav-item .nav-link.active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.12);
}
.sidebar .nav-item .nav-link i {
    margin-right: 0.5rem;
    opacity: 0.85;
}
.sidebar .sidebar-brand {
    height: 4.375rem;
    color: #fff;
    font-weight: 800;
    font-size: 1.1rem;
}
.sidebar .sidebar-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}
.sidebar .collapse-inner .collapse-item.active,
.sidebar .collapse-inner .collapse-item:hover {
    background-color: #eaecf4;
    color: var(--gpms-primary-dark);
}
.bg-gradient-primary {
    background: linear-gradient(180deg, var(--gpms-primary) 10%, var(--gpms-primary-dark) 100%);
}

.sidebar-card {
    margin: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
    background: rgba(0, 0, 0, 0.15);
}

/* ---------- Topbar ---------- */
.topbar .nav-link {
    color: #5a5c69;
}
.topbar .dropdown-list {
    width: 20rem;
    padding: 0;
}
.avatar-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--gpms-primary);
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
}

/* ---------- Cards / KPIs ---------- */
.card {
    border: none;
    border-radius: 0.5rem;
}
.border-left-primary { border-left: 0.25rem solid var(--gpms-primary) !important; }
.border-left-success { border-left: 0.25rem solid #1cc88a !important; }
.border-left-info    { border-left: 0.25rem solid #36b9cc !important; }
.border-left-warning { border-left: 0.25rem solid #f6c23e !important; }
.border-left-danger  { border-left: 0.25rem solid #e74a3b !important; }

.text-gray-800 { color: #5a5c69 !important; }
.text-gray-300 { color: #dddfeb !important; }
.text-gray-600 { color: #858796 !important; }

.chart-area { position: relative; height: 20rem; }
.chart-bar  { position: relative; height: 18rem; }
.chart-pie  { position: relative; height: 15rem; }

/* ---------- Buttons ---------- */
.btn-primary {
    background-color: var(--gpms-primary);
    border-color: var(--gpms-primary);
}
.btn-primary:hover {
    background-color: var(--gpms-primary-dark);
    border-color: var(--gpms-primary-dark);
}

/* ---------- Login ---------- */
.login-card, .login-bg .bg-white {
    border-radius: 1rem;
}

/* ---------- Tables ---------- */
.table thead th {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
    color: #858796;
    background: #f8f9fc;
}

/* ---------- Misc ---------- */
.scroll-to-top {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--gpms-primary);
    color: #fff;
    border-radius: 50%;
    z-index: 1040;
}
.scroll-to-top:hover { color: #fff; }

.sticky-footer {
    padding: 1.5rem 0;
    border-top: 1px solid #e3e6f0;
}

/* ---------- Print ---------- */
@media print {
    .sidebar,
    .topbar,
    .scroll-to-top,
    .sticky-footer,
    .no-print {
        display: none !important;
    }
    #content-wrapper {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    #wrapper {
        width: 100% !important;
    }
    body {
        background: #fff !important;
    }
    .document-brand img {
        max-height: 64px;
    }
    .card {
        border: none !important;
        box-shadow: none !important;
    }
    .table {
        border: 1px solid #dee2e6 !important;
    }
}

@media (max-width: 768px) {
    .sidebar { width: 100%; }
    .chart-area, .chart-bar, .chart-pie { height: 14rem; }
}
