﻿/* =========================================================
   SuiSutaERP - Dasher Theme Integration (Clean Overrides)
   ========================================================= */

/* ----- Reset & Base ----- */
html, body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    background-color: var(--ds-body-bg, #f8f9fa);
}

/* ----- Sidebar ----- */
#miniSidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1035;
    width: 250px;
    background-color: var(--ds-body-bg);
    border-right: 1px dashed var(--ds-gray-300);
    transition: width 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

    #miniSidebar .brand-logo {
        padding: 0.75rem 1rem;
        background-color: var(--ds-body-bg);
        position: sticky;
        top: 0;
        z-index: 2;
        min-height: 64px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #miniSidebar .site-logo-text {
        display: inline-block;
    }

    #miniSidebar .site-logo-mini {
        display: none;
    }

html.collapsed #miniSidebar {
    width: 60px;
}

    html.collapsed #miniSidebar .site-logo-text {
        display: none;
    }

    html.collapsed #miniSidebar .site-logo-mini {
        display: inline-block;
    }

    html.collapsed #miniSidebar .nav-link .text {
        display: none;
    }

    html.collapsed #miniSidebar .nav-link .nav-icon {
        margin-right: 0;
    }

html.expanded #miniSidebar {
    width: 250px;
}

    html.expanded #miniSidebar .site-logo-text {
        display: inline-block;
    }

    html.expanded #miniSidebar .site-logo-mini {
        display: none;
    }

    html.expanded #miniSidebar .nav-link .text {
        display: inline;
        margin-left: 0.5rem;
    }

#miniSidebar .nav-ul {
    list-style: none;
    padding-left: 3px;
    margin: 0;
}

#miniSidebar .nav-item {
    margin-bottom: 2px;
}

#miniSidebar .nav-link {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    color: var(--ds-gray-600);
    font-weight: 500;
    border-radius: 0.5rem;
    margin: 0.125rem 0.5rem;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
}

    #miniSidebar .nav-link .nav-icon {
        font-size: 18px;
        min-width: 24px;
        text-align: center;
        margin-right: 8px;
    }

    #miniSidebar .nav-link .text {
        display: inline-block;
        margin-left: 0.25rem;
    }

    #miniSidebar .nav-link:hover {
        background-color: var(--ds-gray-100);
        color: var(--ds-gray-700);
    }

    #miniSidebar .nav-link.active {
        background-color: var(--ds-primary-bg-subtle);
        color: var(--ds-primary);
    }

/* ----- Main Content ----- */
#content {
    transition: margin-left 0.3s ease;
    min-height: 100vh;
    padding: 80px 40px 40px 40px;
}

html.collapsed #content {
    margin-left: 60px;
}

html.expanded #content {
    margin-left: 250px;
}

/* ----- Topbar ----- */
.navbar-glass {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1034;
    min-height: 64px;
    padding: 0.5rem 1.5rem;
    backdrop-filter: blur(6px);
    background-color: rgba(255, 255, 255, 0.6);
    border-bottom: 1px dashed var(--ds-gray-300);
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

html.collapsed .navbar-glass {
    width: calc(100% - 60px);
}

html.expanded .navbar-glass {
    width: calc(100% - 250px);
}

.navbar-glass .btn-icon {
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: transparent;
    border: none;
}

    .navbar-glass .btn-icon:hover {
        background: var(--ds-gray-100);
    }

/* ----- Sidebar Overlay (Mobile) ----- */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 1040;
    opacity: 0;
    transition: opacity 0.3s ease;
}

    .sidebar-overlay.show {
        display: block;
        opacity: 1;
    }

/* ----- Mobile Responsive (990px) ----- */
@media (max-width: 990px) {
    #miniSidebar {
        display: none;
        width: 280px;
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 1050;
        background: var(--ds-body-bg);
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.15);
        overflow-y: auto;
    }

        #miniSidebar.mobile-open {
            display: block !important;
        }

    #content {
        margin-left: 0 !important;
        padding: 80px 20px 20px 20px;
        width: 100%;
    }

    .navbar-glass,
    html.collapsed .navbar-glass,
    html.expanded .navbar-glass {
        width: 100% !important;
        left: 0;
        right: 0;
    }

    html.collapsed #miniSidebar,
    html.expanded #miniSidebar {
        display: none;
    }

        html.collapsed #miniSidebar.mobile-open,
        html.expanded #miniSidebar.mobile-open {
            display: block !important;
        }
}

@media (max-width: 576px) {
    #content {
        padding: 70px 12px 12px 12px;
    }

    .navbar-glass {
        padding: 0.5rem 0.75rem;
        min-height: 56px;
    }
}

/* ----- Custom Helpers ----- */
.icon-size {
    font-size: 18px;
}

.custom-container {
    width: 100%;
    max-width: 100%;
    padding: 0;
}

img, svg, video {
    max-width: 100%;
}

.table-responsive {
    max-width: 100%;
    overflow-x: auto;
}

/* =========================================================
   বাংলা ফন্ট সেটআপ (Li Ador Noirrit) – সব জায়গায়
   ========================================================= */
@font-face {
    font-family: 'LiAdorNoirrit';
    src: url('/font/liador_noirrit_regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'LiAdorNoirrit';
    src: url('/font/li_ador_noirrit_semibold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: 'LiAdorNoirrit';
    src: url('/font/li_ador_noirrit_bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

/* ফন্ট সব জায়গায় প্রয়োগ (স্ট্যাটিক + ডাইনামিক) */
body,
label, .form-label, .form-check-label,
input, select, textarea,
button, .btn,
h1, h2, h3, h4, h5, h6,
p, span, div,
.form-control, .input-group-text,
.nav-link, .dropdown-item,
.card-title, .card-header,
th, td, .table,
.small, .text-muted,
.list-group-item, .alert {
    font-family: 'LiAdorNoirrit', 'Public Sans', sans-serif !important;
}

/* =========================================================
   Customer Search Results
   ========================================================= */
#customerResults {
    border-radius: 0.375rem !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    background: #fff !important;
    position: absolute !important;
    width: calc(100% - 2px) !important;
    z-index: 1050 !important;
    max-height: 250px !important;
    overflow-y: auto !important;
}

    #customerResults .list-group-item {
        cursor: pointer;
        border: none !important;
        border-bottom: 1px solid #f0f0f0 !important;
        padding: 0.5rem 0.75rem !important;
        font-family: 'LiAdorNoirrit', 'Public Sans', sans-serif !important;
    }

        #customerResults .list-group-item:hover {
            background-color: var(--bs-primary, #0d6efd) !important;
            color: #fff !important;
        }

        #customerResults .list-group-item:last-child {
            border-bottom: none !important;
        }

/* ============================================================
   Sidebar Brand Logo – Auto-switch (Full ↔ Icon)
   Theme: theme.css এর html.collapsed / html.expanded অনুযায়ী
   ============================================================ */

/* Default (expanded ধরে) — full logo */
#miniSidebar .sidebar-logo-full {
    display: inline-block;
    height: 50px;
    width: auto;
}

#miniSidebar .sidebar-logo-icon {
    display: none;
    height: 50px;
    width: auto;
}

/* ✅ Expanded state — full logo, বাম দিকে */
html.expanded #miniSidebar .sidebar-logo-full {
    display: inline-block;
    height: 50px;
}

html.expanded #miniSidebar .sidebar-logo-icon {
    display: none;
}

html.expanded #miniSidebar .brand-logo {
    padding: 0.75rem 1rem;
    justify-content: flex-start;
}

html.collapsed #miniSidebar .sidebar-logo-full {
    display: none;
}

html.collapsed #miniSidebar .sidebar-logo-icon {
    display: inline-block;
    height: 64px;
    width: auto;
    max-width: 100%;
}

html.collapsed #miniSidebar .brand-logo {
    padding: 4px 2px;
    justify-content: center;
    align-items: center;
}

/* ✅ Dark mode */
[data-bs-theme="dark"] #miniSidebar .sidebar-logo-full,
[data-bs-theme="dark"] #miniSidebar .sidebar-logo-icon {
    filter: brightness(1.1);
}

/* ✅ Small screen (≤768px) */
@media (max-width: 768px) {
    #miniSidebar .brand-logo {
        padding: 0.5rem 1rem;
    }

    html.collapsed #miniSidebar .sidebar-logo-icon {
        height: 52px;
    }
}

/* ============================================================
   Mobile Sidebar – Solid Background (কোনো glass/transparency নয়)
   Double-click fix এর সাথে সামঞ্জস্যপূর্ণ
   ============================================================ */
@media (max-width: 990px) {
    #miniSidebar,
    html.collapsed #miniSidebar,
    html.expanded #miniSidebar {
        background-color: #ffffff !important;
        background-image: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        opacity: 1 !important;
        isolation: isolate;
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.15) !important;
    }

    [data-bs-theme="dark"] #miniSidebar,
    [data-bs-theme="dark"] html.collapsed #miniSidebar,
    [data-bs-theme="dark"] html.expanded #miniSidebar {
        background-color: #141a21 !important;
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.5) !important;
    }

    /* Sidebar overlay – নিশ্চিত dark background */
    .sidebar-overlay {
        background: rgba(0, 0, 0, 0.55) !important;
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
    }
}

.ti-spin {
    animation: ti-spin 1s linear infinite;
}

@keyframes ti-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}
/* ============================================================
   Stock In Modal — Custom Styles
   ============================================================ */
.stockin-header {
    background: var(--ds-primary-bg-subtle, #c8fad6);
    border-left: 4px solid var(--ds-primary, #00a76f);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

[data-bs-theme="dark"] .stockin-header {
    background: rgba(0, 167, 111, 0.12);
}

.stockin-item-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--ds-primary-text-emphasis, #007867);
    display: flex;
    align-items: center;
    gap: 8px;
}

    .stockin-item-name i {
        font-size: 20px;
    }

.stockin-item-meta {
    font-size: 12.5px;
    color: var(--ds-gray-600, #637381);
    margin-top: 4px;
}

/* Expense mirror toggle box */
.mirror-expense-box {
    background: var(--ds-gray-100, #f9fafb);
    border: 1px dashed var(--ds-border-color, #e5e7eb);
    border-radius: 10px;
    padding: 12px 16px;
}

[data-bs-theme="dark"] .mirror-expense-box {
    background: rgba(255, 255, 255, 0.03);
}

.mirror-expense-box .form-check-input:checked {
    background-color: var(--ds-primary, #00a76f);
    border-color: var(--ds-primary, #00a76f);
}

/* Modal size adjustment */
#stockInModal .modal-dialog {
    max-width: 720px;
}

/* Smooth loading state on submit */
#stockInSubmitBtn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}