/* ========================================
   SIDEBAR & LAYOUT STYLES
   ======================================== */

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 250px;
    background: #2c3e50;
    transition: all 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar-header {
    padding: 20px;
    background: #1a252f;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
}

.sidebar-brand {
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-brand {
    opacity: 0;
    width: 0;
}

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

.sidebar-menu li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: #ecf0f1;
    text-decoration: none;
    transition: all 0.3s ease;
}

.sidebar-menu a:hover {
    background: #34495e;
    padding-left: 25px;
}

.sidebar-menu a.active {
    background: #3498db;
    border-left: 4px solid #2980b9;
}

.sidebar-menu i {
    font-size: 1.3rem;
    min-width: 30px;
    margin-right: 15px;
}

.sidebar.collapsed .sidebar-menu i {
    margin-right: 0;
}

.sidebar-menu span {
    white-space: nowrap;
}

.sidebar.collapsed .sidebar-menu span {
    display: none;
}

/* Header Styles */
.main-header {
    position: fixed;
    top: 0;
    left: 250px;
    right: 0;
    height: 70px;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    padding: 0 20px;
    transition: all 0.3s ease;
    z-index: 999;
}

.main-header.sidebar-collapsed {
    left: 70px;
}

.burger-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #2c3e50;
    padding: 5px 10px;
    margin-right: 20px;
}

.burger-btn:hover {
    color: #3498db;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #3498db;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: pointer;
}

/* Main Content */
.main-content {
    margin-left: 250px;
    margin-top: 70px;
    padding: 20px;
    transition: all 0.3s ease;
    min-height: calc(100vh - 70px);
}

.main-content.sidebar-collapsed {
    margin-left: 70px;
}

/* Main content without sidebar (login page) */
body:not(:has(.sidebar)) .main-content {
    margin-left: 0;
    margin-top: 0;
    padding: 0;
    min-height: 100vh;
}

/* Footer Styles */
.main-footer {
    margin-left: 250px;
    transition: all 0.3s ease;
    background: white;
    padding: 20px;
    border-top: 1px solid #e0e0e0;
}

.main-footer.sidebar-collapsed {
    margin-left: 70px;
}

/* Scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #1a252f;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #34495e;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #3498db;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar {
        left: -250px;
    }

    .sidebar.active {
        left: 0;
    }

    .main-header {
        left: 0;
    }

    .main-content, .main-footer {
        margin-left: 0;
    }
    
    body:not(:has(.sidebar)) .main-content {
        margin-top: 0;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .sidebar-overlay.active {
        display: block;
    }
    
    /* Reduce navbar and header text size on mobile */
    .sidebar-brand {
        font-size: 1rem;
    }
    
    .sidebar-menu a {
        font-size: 0.9rem;
        padding: 12px 15px;
    }
    
    .sidebar-menu i {
        font-size: 1.1rem;
    }
    
    .main-header {
        height: 60px;
        font-size: 0.9rem;
    }
    
    .user-avatar {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    /* Reduce content title and heading sizes */
    .main-content h1 {
        font-size: 1.75rem;
    }
    
    .main-content h2 {
        font-size: 1.5rem;
    }
    
    .main-content h3 {
        font-size: 1.25rem;
    }
    
    .main-content h4 {
        font-size: 1.1rem;
    }
    
    .main-content h5 {
        font-size: 1rem;
    }
    
    .main-content h6 {
        font-size: 0.9rem;
    }
    
    /* Adjust main content padding */
    .main-content {
        padding: 15px;
        margin-top: 60px;
    }
    
    /* Reduce button text size and dimensions */
    .main-content .btn {
        font-size: 0.9rem;
        padding: 0.4rem 0.85rem;
    }
    
    .main-content .btn-sm {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
    
    .main-content .btn-lg {
        font-size: 1rem;
        padding: 0.5rem 1rem;
    }
    
    .main-content .btn i {
        font-size: 0.9rem;
    }
    
    /* Reduce spacing between elements */
    .main-content .row {
        row-gap: 1rem !important;
    }
    
    .main-content .g-4 {
        gap: 1rem !important;
    }
    
    .main-content .mb-4 {
        margin-bottom: 1rem !important;
    }
    
    .main-content .mb-3 {
        margin-bottom: 0.75rem !important;
    }
    
    .main-content .mb-2 {
        margin-bottom: 0.5rem !important;
    }
    
    .main-content .mt-4 {
        margin-top: 1rem !important;
    }
    
    .main-content .mt-3 {
        margin-top: 0.75rem !important;
    }
    
    .main-content .pt-3,
    .main-content .py-3 {
        padding-top: 0.75rem !important;
    }
    
    .main-content .pb-3,
    .main-content .py-3 {
        padding-bottom: 0.75rem !important;
    }
    
    /* Reduce card spacing */
    .main-content .card {
        margin-bottom: 1rem;
    }
    
    .main-content .card-body {
        padding: 1rem;
    }
    
    /* Reduce gap between header title and button */
    .main-content .d-flex.justify-content-between {
        gap: 0.75rem;
    }
    
    /* Reduce footer text size */
    .main-footer {
        font-size: 0.85rem;
        padding: 15px;
    }
    
    /* Breadcrumb responsive */
    .breadcrumb {
        font-size: 0.85rem;
        padding: 0.5rem 0;
    }
}

@media (max-width: 576px) {
    /* Further reduce text size on smaller screens */
    .sidebar-brand {
        font-size: 0.9rem;
    }
    
    .sidebar-menu a {
        font-size: 0.85rem;
        padding: 10px 12px;
    }
    
    .sidebar-menu i {
        font-size: 1rem;
    }
    
    .main-header {
        height: 55px;
        padding: 0 15px;
    }
    
    .burger-btn {
        font-size: 1.3rem;
        margin-right: 10px;
    }
    
    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }
    
    /* Further reduce content titles */
    .main-content h1 {
        font-size: 1.5rem;
    }
    
    .main-content h2 {
        font-size: 1.3rem;
    }
    
    .main-content h3 {
        font-size: 1.15rem;
    }
    
    .main-content h4 {
        font-size: 1rem;
    }
    
    .main-content h5 {
        font-size: 0.95rem;
    }
    
    .main-content h6 {
        font-size: 0.85rem;
    }
    
    .main-content p,
    .main-content .text-muted {
        font-size: 0.9rem;
    }
    
    /* Adjust main content padding */
    .main-content {
        padding: 12px;
        margin-top: 55px;
    }
    
    /* Further reduce button text size and dimensions */
    .main-content .btn {
        font-size: 0.85rem;
        padding: 0.35rem 0.75rem;
    }
    
    .main-content .btn-sm {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    .main-content .btn-lg {
        font-size: 0.95rem;
        padding: 0.45rem 0.9rem;
    }
    
    .main-content .btn i {
        font-size: 0.85rem;
    }
    
    /* Further reduce spacing on smaller mobile */
    .main-content .row {
        row-gap: 0.75rem !important;
    }
    
    .main-content .g-4 {
        gap: 0.75rem !important;
    }
    
    .main-content .mb-4 {
        margin-bottom: 0.75rem !important;
    }
    
    .main-content .mb-3 {
        margin-bottom: 0.5rem !important;
    }
    
    .main-content .mb-2 {
        margin-bottom: 0.35rem !important;
    }
    
    .main-content .mt-4 {
        margin-top: 0.75rem !important;
    }
    
    .main-content .mt-3 {
        margin-top: 0.5rem !important;
    }
    
    .main-content .pt-3,
    .main-content .py-3 {
        padding-top: 0.5rem !important;
    }
    
    .main-content .pb-3,
    .main-content .py-3 {
        padding-bottom: 0.5rem !important;
    }
    
    /* Further reduce card spacing */
    .main-content .card {
        margin-bottom: 0.75rem;
    }
    
    .main-content .card-body {
        padding: 0.85rem;
    }
    
    /* Reduce gap in flex containers */
    .main-content .d-flex.gap-2 {
        gap: 0.35rem !important;
    }
    
    /* Reduce gap between header title and button */
    .main-content .d-flex.justify-content-between {
        gap: 0.5rem;
    }
    
    .main-content .d-flex.justify-content-between > div:first-child {
        flex: 1;
        min-width: 0;
    }
    
    /* Stack header elements on very small screens */
    .main-content .row.mb-4 .d-flex.justify-content-between {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    /* Further reduce footer text size */
    .main-footer {
        font-size: 0.75rem;
        padding: 12px;
    }
    
    /* Breadcrumb responsive for small screens */
    .breadcrumb {
        font-size: 0.8rem;
        padding: 0.4rem 0;
    }
    
}
/* ========================================
   GENERAL STYLES
   ======================================== */

/* Container Styles */
.main-content {
    background-color: #f6f6f6;
}

/* Breadcrumb Styles */
.breadcrumb {
    background-color: transparent;
    padding: 0.75rem 0;
    margin-bottom: 0;
    font-size: 0.9rem;
}

.breadcrumb-item {
    color: #6c757d;
}

.breadcrumb-item a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-item a:hover {
    color: #2980b9;
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #495057;
    font-weight: 500;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: #6c757d;
}

/* Filter Section Styles */
.card-header .btn-link {
    padding: 0;
    font-size: 1rem;
}

.card-header .btn-link:hover {
    color: #3498db !important;
}

.card-header .btn-link:focus {
    box-shadow: none;
}

.card-header .btn-link i.bi-chevron-down {
    transition: transform 0.3s ease;
}

.card-header .btn-link[aria-expanded="true"] i.bi-chevron-down {
    transform: rotate(180deg);
}

/* Readonly Input Styles */
input[readonly],
textarea[readonly],
select[readonly] {
    background-color: #f5f5f5 !important;
    cursor: not-allowed;
    border-color: #e0e0e0 !important;
}

input[readonly]:focus,
textarea[readonly]:focus,
select[readonly]:focus {
    background-color: #f5f5f5 !important;
    box-shadow: none !important;
    border-color: #e0e0e0 !important;
}

/* Readonly input groups */
.input-group input[readonly] {
    background-color: #f5f5f5 !important;
}

.input-group-text {
    background-color: #f8f9fa;
    border-color: #e0e0e0;
}

.icon-group {
    display: flex;
    align-items: center;
}

.icon-group .fa {
    margin-left: 10px;
    font-size: 1.2em;
    cursor: pointer;
}

.circular-chart {
    display: block;
    margin: 10px auto;
    max-width: 80%;
    max-height: 250px;
}

.circle-bg {
    fill: none;
    stroke: #eee;
    stroke-width: 4;
}

.circle {
    fill: none;
}

.card-container {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    padding-left: 20px;
    padding-right: 20px;
    padding-top: 10px;
    padding-bottom: 10px;
}

.progress-circle {
    display: flex;
    align-items: center;
    justify-content: center;
}

.Black-800 {
    color: #4f4f4f
}

.Black-400 {
    color: #EFEFEF
}

.fs-16 {
    font-size: 16px;
}

.fs-21 {
    font-size: 21px;
}

.fs-24 {
    font-size: 24px;
}

.fs-28 {
    font-size: 28px;

}

.fw-500 {
    font-weight: 500;
}

.fw-400 {
    font-weight: 400;
}

.fw-600 {
    font-weight: 600;
}

.alert-custom {
    position: fixed;
    top: 20px;
    right: 20px;
    height: 80px;
    background-color: #77B843;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1050;
}

.alert-custom .btn-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    margin-left: 10px;
}

.alert-custom.fade-out {
    animation: fadeOut 0.5s forwards;
}

@keyframes fadeOut {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

.hl-1,
.hl-2,
.hl-3,
.hl-4 {
    height: auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-radius: 3px;
    padding: 2px 4px;
    font-size: 1rem;
    text-align: center;
    margin-left: 16px;
    font-weight: 500;
}

.hl-1 {
    background-color: #f0f8ff;
    color: #53AAFC;
    border: 1px solid #53AAFC;
}

.hl-2 {
    background-color: #ECE9FF;
    color: #B0A8F6;
    border: 1px solid #B0A8F6;
}

.hl-3 {
    background-color: #F7FCEC;
    color: #77B843;
    border: 1px solid #DFF7B8;
}

.hl-4 {
    background-color: #FAF8F8;
    color: #2D6A15;
    border: 1px solid #5B9E30;
}

@media (min-width: 1024px) {

    .hl-1,
    .hl-2,
    .hl-3,
    .hl-4 {
        width: 3.681vw;
        height: 27px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {

    .hl-1,
    .hl-2,
    .hl-3,
    .hl-4 {
        width: 80px;
        height: auto;
        font-size: 0.9rem;
        padding: 4px 8px;
    }
}

@media (max-width: 767px) {

    .hl-1,
    .hl-2,
    .hl-3,
    .hl-4 {
        width: 70px;
        height: auto;
        font-size: 0.8rem;
        padding: 4px 8px;
    }
}

@media (min-width: 576px) {
    #documentModal .modal-dialog {
        max-width: 1000px;
        margin: 1.75rem auto;
    }
}

#searchInput::placeholder {
    color: #8A8A8A !important;
}

/* ========================================
   PRODUCT/LISTING CARD STYLES (Global)
   ======================================== */

/* Product Card Styles */
.product-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Product Image Container */
.product-image-container {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 8px;
    background-color: #f8f9fa;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

/* Product Details */
.product-details {
    font-size: 0.9rem;
}

/* Action Buttons */
.product-actions .btn {
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
}

.product-actions .btn:hover {
    transform: translateY(-2px);
    transition: all 0.2s ease;
}

/* Badge Styles */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* Loading Animation */
.product-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Empty State */
.bi-inbox {
    font-size: 4rem !important;
}


/* Responsive Adjustments - Mobile */
@media (max-width: 768px) {
    .product-image-container {
        height: 180px;
    }
    
    .product-actions .btn {
        font-size: 0.8rem;
        padding: 0.35rem 0.5rem;
    }
}

@media (max-width: 576px) {
    .product-image-container {
        height: 200px;
    }
}

/* ========================================
   CHART CONTAINER STYLES (Global)
   ======================================== */

/* Chart Container Utility Class */
.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Responsive Chart Heights */
@media (max-width: 1024px) {
    .chart-container {
        height: 350px;
    }
}

@media (max-width: 768px) {
    .chart-container {
        height: 300px;
    }
}

@media (max-width: 576px) {
    .chart-container {
        height: 250px;
    }
}