/*
=====================================================
MoonPOS - poscss.css
Modern SaaS + POS UI
=====================================================
*/

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;

    --success: #16a34a;
    --danger: #dc2626;
    --warning: #f59e0b;

    --bg: #f8fafc;
    --card: #ffffff;

    --text: #0f172a;
    --text-light: #64748b;

    --border: #e2e8f0;

    --sidebar-width: 260px;

    --radius: 18px;

    --shadow:
        0 4px 20px rgba(0, 0, 0, .05);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;

    font-family:
        "Inter",
        "Segoe UI",
        sans-serif;

    background: var(--bg);

    color: var(--text);

    overflow-x: hidden;
}

/*
=====================================================
LOGIN PAGE
=====================================================
*/

.login-page {
    min-height: 100vh;

    display: flex;

    background: var(--bg);
}

.login-left {
    flex: 1;

    background:
        linear-gradient(135deg,
            #2563eb,
            #1d4ed8);

    color: #fff;

    padding: 60px;

    display: flex;

    flex-direction: column;

    justify-content: center;
}

.login-logo {
    font-size: 48px;

    font-weight: 700;

    margin-bottom: 20px;
}

.login-title {
    font-size: 38px;

    font-weight: 700;

    margin-bottom: 15px;
}

.login-desc {
    font-size: 18px;

    opacity: .9;

    max-width: 500px;
}

.login-features {
    margin-top: 50px;
}

.login-feature {
    margin-bottom: 18px;

    font-size: 16px;
}

.login-right {
    width: 480px;

    background: #fff;

    display: flex;

    justify-content: center;

    align-items: center;

    padding: 40px;
}

.login-card {
    width: 100%;

    max-width: 380px;
}

.login-card h2 {
    font-weight: 700;

    margin-bottom: 10px;
}

.login-subtitle {
    color: var(--text-light);

    margin-bottom: 30px;
}

.form-control {
    height: 52px;

    border-radius: 14px;

    border: 1px solid var(--border);

    padding: 12px 16px;

    box-shadow: none;
}

.form-control:focus {
    border-color: var(--primary);

    box-shadow:
        0 0 0 4px rgba(37, 99, 235, .1);
}

.btn-primary {
    background: var(--primary);

    border: none;

    height: 52px;

    border-radius: 14px;

    font-weight: 600;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

/*
=====================================================
APP LAYOUT
=====================================================
*/

.app-layout {
    display: flex;

    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);

    background: #fff;

    border-right:
        1px solid var(--border);

    position: fixed;

    top: 0;
    left: 0;
    bottom: 0;

    z-index: 1000;

    overflow-y: auto;
}

.sidebar-brand {
    height: 72px;

    display: flex;

    align-items: center;

    padding: 0 25px;

    font-size: 24px;

    font-weight: 700;

    border-bottom:
        1px solid var(--border);
}

.sidebar-menu {
    padding: 20px 0;
}

.sidebar-item {
    display: flex;

    align-items: center;

    gap: 14px;

    padding: 14px 25px;

    color: var(--text);

    text-decoration: none;

    transition: .2s;
}

.sidebar-item:hover {
    background: #f1f5f9;

    color: var(--primary);
}

.sidebar-item.active {
    background:
        rgba(37, 99, 235, .1);

    color: var(--primary);

    font-weight: 600;
}

.sidebar-item i {
    width: 20px;
}

/*
=====================================================
MAIN CONTENT
=====================================================
*/

.main-content {
    flex: 1;

    margin-left:
        var(--sidebar-width);
}

.topbar {
    height: 72px;

    background: #fff;

    border-bottom:
        1px solid var(--border);

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: 0 30px;

    position: sticky;

    top: 0;

    z-index: 900;
}

.topbar-user {
    display: flex;

    align-items: center;

    gap: 15px;
}

.user-avatar {
    width: 40px;
    height: 40px;

    border-radius: 50%;

    background: var(--primary);

    color: #fff;

    display: flex;

    align-items: center;

    justify-content: center;

    font-weight: 700;
}

.page-content {
    padding: 30px;
}

/*
=====================================================
CARDS
=====================================================
*/

.stat-card {
    background: #fff;

    border-radius: var(--radius);

    padding: 24px;

    box-shadow: var(--shadow);

    height: 100%;
}

.stat-title {
    color: var(--text-light);

    font-size: 14px;
}

.stat-value {
    font-size: 32px;

    font-weight: 700;

    margin-top: 10px;
}

/*
=====================================================
TABLE
=====================================================
*/

.table-card {
    background: #fff;

    border-radius: var(--radius);

    box-shadow: var(--shadow);

    overflow: hidden;
}

.table {
    margin: 0;
}

/*
=====================================================
POS
=====================================================
*/

.pos-layout {
    display: grid;

    grid-template-columns:
        2fr 1fr;

    gap: 25px;
}

.pos-products,
.pos-cart {
    background: #fff;

    border-radius: var(--radius);

    box-shadow: var(--shadow);

    padding: 20px;
}

/*
=====================================================
MOBILE
=====================================================
*/

.mobile-toggle {
    display: none;
}

@media(max-width:991px) {

    .sidebar {
        transform:
            translateX(-100%);

        transition: .3s;
    }

    .sidebar.show {
        transform:
            translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-toggle {
        display: block;
    }

    .login-left {
        display: none;
    }

    .login-right {
        width: 100%;
    }

    .page-content {
        padding: 20px;
    }

    .pos-layout {
        grid-template-columns: 1fr;
    }
}

@media(max-width:576px) {

    .page-content {
        padding: 15px;
    }

    .topbar {
        padding: 0 15px;
    }

    .stat-value {
        font-size: 26px;
    }

    .sidebar {
        width: 280px;
    }
}

.product-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

#sidebarOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    z-index: 998;
    display: none;
}

#sidebarOverlay.show {
    display: block;
}

@media(min-width: 992px) {

    #sidebarOverlay {
        display: none !important;
    }

}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#closeSidebar {
    color: #fff;
}

.product-picker-item {

    display: flex;

    align-items: center;

    gap: 12px;

    padding: 12px;

    border-radius: 12px;

    cursor: pointer;

    transition: 0.2s;

    border: 1px solid transparent;
}

.product-picker-item:hover {

    background: #f8fafc;

    border-color: #e2e8f0;
}

.product-picker-image {

    width: 60px;

    height: 60px;

    object-fit: cover;

    border-radius: 12px;

    border: 1px solid #e2e8f0;

    flex-shrink: 0;
}

.product-picker-placeholder {

    width: 60px;

    height: 60px;

    border-radius: 12px;

    background: #f8fafc;

    display: flex;

    align-items: center;

    justify-content: center;
}

.product-search-results {

    position: absolute;

    top: 100%;

    left: 0;

    right: 0;

    z-index: 1056;

    background: #fff;

    border: 1px solid #dee2e6;

    border-radius: 12px;

    box-shadow:

        0 5px 15px rgba(0, 0, 0, .1);

    max-height: 350px;

    overflow-y: auto;

    display: none;
}

.product-search-item {

    display: flex;

    gap: 12px;

    align-items: center;

    padding: 12px;

    cursor: pointer;
}

.product-search-item:hover {

    background: #f8f9fa;
}

.product-search-image {

    width: 50px;

    height: 50px;

    border-radius: 10px;

    object-fit: cover;
}

/* pos layout */
.pos-layout .sticky-top {

    top: 20px;
}

@media(max-width:991px) {

    .pos-layout .sticky-top {

        position: fixed;

        bottom: 0;

        left: 0;

        right: 0;

        top: auto;

        z-index: 1040;

        border-radius: 20px 20px 0 0;
    }

    .main-content {

        padding-bottom: 350px;
    }

}

.tab-pane .table {
    width: 100% !important;
}

/* =====================================================
   MOBILE OPTIMIZE
===================================================== */

@media (max-width: 991px) {

    /* tables */

    .table-responsive {
        border-radius: 12px;
    }

    .table {
        font-size: 14px;
        white-space: nowrap;
    }

    /* cards */

    .card {
        margin-bottom: 15px;
    }

    .card-body {
        padding: 15px;
    }

    /* buttons */

    .btn {
        min-height: 42px;
    }

    .btn-group {
        flex-wrap: wrap;
    }

    /* forms */

    .row>[class*="col-"] {
        margin-bottom: 10px;
    }

    /* dashboard stats */

    .stat-card {
        padding: 18px;
    }

    .stat-value {
        font-size: 24px;
    }

    /* topbar */

    .topbar {
        gap: 10px;
    }

    .topbar-user {
        gap: 8px;
    }

    /* modal */

    .modal-dialog {
        margin: .5rem;
    }

    /* search */

    .product-search-results {
        max-height: 250px;
    }

    /* images */

    .product-thumb {
        width: 40px;
        height: 40px;
    }

}

/* =====================================================
   SMALL MOBILE
===================================================== */

@media (max-width: 576px) {

    /* content */

    .page-content {
        padding: 12px;
    }

    /* heading */

    h1 {
        font-size: 1.4rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    h3 {
        font-size: 1.1rem;
    }

    /* cards */

    .stat-card {
        padding: 15px;
    }

    .stat-title {
        font-size: 12px;
    }

    .stat-value {
        font-size: 20px;
    }

    /* tables */

    .table {
        font-size: 13px;
    }

    /* forms */

    .form-control {
        height: 46px;
    }

    /* buttons */

    .btn {
        font-size: 14px;
    }

    /* user avatar */

    .user-avatar {
        width: 34px;
        height: 34px;
        font-size: 13px;
    }

    /* pos cart fixed */

    .pos-layout .sticky-top {
        padding: 15px;
    }

}

/* css resp */
.mobile-label {
    display: none;
    color: #6c757d;
}

@media (max-width: 768px) {
    .mobile-label {
        display: inline-block;
        min-width: 90px;
        font-weight: 600;
        color: #212529;
    }
}

.product_name_invoice {
    font-weight: bold;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;

    overflow: hidden;
    line-height: 1.3;
    max-height: calc(1.3em * 2);
}

/* ==========================================================
   LEM!POS Select2 Theme
   Bootstrap 5.3.x
   ========================================================== */

.select2-container {
    width: 100% !important;
}

/* =========================
   Single Select
   ========================= */

.select2-container--default .select2-selection--single {

    display: flex;
    align-items: center;

    height: 42px !important;

    border: 1px solid var(--bs-border-color) !important;

    border-radius: var(--bs-border-radius) !important;

    background: var(--bs-body-bg);

    transition:
        border-color .15s ease,
        box-shadow .15s ease;

}

.select2-container--default .select2-selection--single .select2-selection__rendered {

    line-height: 40px !important;

    padding-left: .75rem;

    padding-right: 2.5rem;

    color: var(--bs-body-color);

    font-size: .95rem;

}

.select2-container--default .select2-selection--single .select2-selection__placeholder {

    color: var(--bs-secondary-color);

}

.select2-container--default .select2-selection--single .select2-selection__arrow {

    height: 40px !important;

    width: 40px;

    right: 0;

}

/* =========================
   Focus
   ========================= */

.select2-container--default.select2-container--focus .select2-selection--single,

.select2-container--default.select2-container--open .select2-selection--single {

    border-color: var(--bs-primary) !important;

    box-shadow:
        0 0 0 .25rem rgba(var(--bs-primary-rgb), .25);

}

/* =========================
   Dropdown
   ========================= */

.select2-dropdown {

    border: 1px solid var(--bs-border-color) !important;

    border-radius: var(--bs-border-radius) !important;

    overflow: hidden;

    box-shadow:
        0 .5rem 1rem rgba(0, 0, 0, .08);

}

/* =========================
   Search
   ========================= */

.select2-search--dropdown {

    padding: .5rem;

}

.select2-search--dropdown .select2-search__field {

    height: 40px;

    border: 1px solid var(--bs-border-color) !important;

    border-radius: var(--bs-border-radius) !important;

    padding: .375rem .75rem;

}

.select2-search__field:focus {

    outline: 0;

    border-color: var(--bs-primary) !important;

    box-shadow:
        0 0 0 .25rem rgba(var(--bs-primary-rgb), .25);

}

/* =========================
   Option
   ========================= */

.select2-results__option {

    padding: .55rem .75rem;

    font-size: .95rem;

}

.select2-container--default .select2-results__option--highlighted .select2-results__option--selectable {

    background: var(--bs-success);

    color: #fff;

}

.select2-container--default .select2-results__option--selected {

    background: rgba(var(--bs-success-rgb), .08);

    color: inherit;

}

/* =========================
   Disabled
   ========================= */

.select2-container--default.select2-container--disabled .select2-selection--single {

    background: var(--bs-secondary-bg);

}

/* =========================
   Flex
   ========================= */

.d-flex>.select2-container {

    flex: 1 1 auto;

}