﻿:root {
    --gs1-blue: #0056A4;
    --gs1-dark-blue: #003D7A;
    --gs1-orange: #f26334;
    --gs1-light-bg: #F4F7FB;
    --gs1-text-main: #333333;
    --gs1-text-muted: #6c757d;
    --gs1-border: #e0e5ed;
    --gs1-white: #ffffff;
    --navy-blue: #003B73;
    --navy-blue-dark: #002B55;
    --navy-blue-soft: rgba(0, 59, 115, 0.08);
    --navy-blue-border: rgba(0, 59, 115, 0.18);
}
body {
    font-family: "Noto Sans Thai", sans-serif;
    background-color: var(--gs1-light-bg);
    color: var(--gs1-text-main);
    -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--gs1-dark-blue);
}

/* Utilities */
.text-gs1-blue {
    color: var(--gs1-blue) !important;
}

.text-navy-blue-dark {
    color: var(--navy-blue-dark) !important;
}

.text-gs1-orange {
    color: var(--gs1-orange) !important;
}

.bg-gs1-blue {
    background-color: var(--gs1-blue) !important;
    color: white;
}

.bg-gs1-dark-blue {
    background-color: var(--gs1-dark-blue) !important;
    color: white;
}

.bg-gs1-orange {
    background-color: var(--gs1-orange) !important;
    color: white;
}

/* Buttons */
.btn-primary {
    background-color: var(--gs1-blue);
    border-color: var(--gs1-blue);
    font-weight: 500;
    padding: 0.5rem 1.5rem;
    transition: all 0.3s ease;
}

    .btn-primary:hover, .btn-primary:focus {
        background-color: var(--gs1-dark-blue);
        border-color: var(--gs1-dark-blue);
        box-shadow: 0 4px 6px rgba(0, 86, 164, 0.2);
    }

.btn-outline-primary {
    color: var(--gs1-blue);
    border-color: var(--gs1-blue);
}

    .btn-outline-primary:hover {
        background-color: var(--gs1-blue);
        color: white;
    }

.btn-warning {
    background-color: var(--gs1-orange);
    border-color: var(--gs1-orange);
    color: white;
    font-weight: 500;
}

    .btn-warning:hover,
    .btn-warning:focus {
        background: linear-gradient(90deg, #f26334, #ff9202);
        border-color: var(--gs1-orange);
        box-shadow: 0 4px 6px rgba(0, 86, 164, 0.2);
        color: white;
    }

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    background-color: var(--gs1-white);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .card:hover.hover-elevate {
        transform: translateY(-4px);
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
    }

.card-header {
    background-color: var(--gs1-white);
    border-bottom: 1px solid var(--gs1-border);
    font-weight: 600;
    border-radius: 12px 12px 0 0 !important;
    padding: 1rem 1.25rem;
}

/* Form Controls */
.form-control, .form-select {
    border: 1px solid var(--gs1-border);
    border-radius: 8px;
    padding: 0.6rem 1rem;
}

    .form-control:focus, .form-select:focus {
        border-color: var(--gs1-blue);
        box-shadow: 0 0 0 0.25rem rgba(0, 86, 164, 0.15);
    }

.input-group-text {
    background-color: white;
    border: 1px solid var(--gs1-border);
}

.form-label {
    font-weight: 500;
    color: var(--gs1-text-main);
    margin-bottom: 0.4rem;
    /*font-size: 16px;*/
    font-size: 1rem;
}

/* Badges */
.badge {
    padding: 0.4em 0.8em;
    border-radius: 6px;
    font-weight: 500;
}

/* Sidebar & Layout */
.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
    min-height: 100vh;
}

.sidebar {
    min-width: 260px;
    max-width: 260px;
    background: linear-gradient(10deg, #034cca 30%,#012664 85%);
    color: #fff;
    transition: all 0.3s;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.sidebar {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}


    .sidebar .sidebar-header {
        padding: 20px;
        background: rgba(0,0,0,0.1);
        text-align: center;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }

    .sidebar ul.components {
        padding: 10px 0;
    }

    .sidebar ul li a {
        padding: 10px 17px;
        font-size: 1em;
        display: block;
        color: rgba(255,255,255,0.8);
        text-decoration: none;
        transition: all 0.2s;
        border-left: 4px solid transparent;
    }

        .sidebar ul li a:hover {
            color: #fff;
            background: rgba(255,255,255,0.05);
        }

    .sidebar ul li.active > a {
        color: #fff;
        background: rgba(255,255,255,0.1);
        border-left: 4px solid var(--gs1-orange);
    }

    .sidebar ul li a i {
        margin-right: 10px;
        width: 20px;
        text-align: center;
    }

    /* scrollbar แบบเรียบ ๆ */
    .sidebar::-webkit-scrollbar {
        width: 6px;
    }

    .sidebar::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, .08);
    }

    .sidebar::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, .35);
        border-radius: 999px;
    }

        .sidebar::-webkit-scrollbar-thumb:hover {
            background: rgba(255, 255, 255, .55);
        }

/* ส่วนเมนูเลื่อน */
.sidebar-menu-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px 8px 24px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

    /* Scrollbar */
    .sidebar-menu-scroll::-webkit-scrollbar {
        width: 6px;
    }

    .sidebar-menu-scroll::-webkit-scrollbar-track {
        background: transparent;
    }

    .sidebar-menu-scroll::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,.28);
        border-radius: 999px;
    }

        .sidebar-menu-scroll::-webkit-scrollbar-thumb:hover {
            background: rgba(255,255,255,.42);
        }



.main-content {
    width: calc(100% - 260px);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Topbar */
.topbar {
    background: var(--gs1-white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    padding: 0.75rem 2rem;
    border-bottom: 1px solid var(--gs1-border);
}

    .topbar .navbar-brand {
        font-weight: 600;
        color: var(--gs1-dark-blue);
    }

    .topbar .user-profile img {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        object-fit: cover;
        border: 2px solid var(--gs1-border);
    }

/* Page Content */
.page-content {
    padding: 2rem;
    flex-grow: 1;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--gs1-dark-blue);
}

/* Summary Cards */
.summary-card .icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.summary-card h3 {
    font-size: 1.75rem;
    margin-bottom: 0;
    font-weight: 700;
}

.summary-card p {
    color: var(--gs1-text-muted);
    margin-bottom: 0;
    font-size: 0.9rem;
}

/* Data Table */
.table {
    vertical-align: middle;
}

    .table th {
        font-weight: 600;
        color: var(--gs1-text-muted);
        border-bottom: 2px solid var(--gs1-border);
        padding: 1rem 0.75rem;
        text-transform: uppercase;
        font-size: 0.75rem;
        letter-spacing: 0.5px;
    }

    .table td {
        padding: 1rem 0.75rem;
        border-bottom: 1px solid var(--gs1-border);
        color: var(--gs1-text-main);
    }

.product-img-thumb {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid var(--gs1-border);
    background-color: #fff;
}

/* Login Page specific */
/*.login-split {
    min-height: 100vh;
}

.login-left {
    background: linear-gradient(0deg, #034ccaff 0%, #012664ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: white;
    position: relative;
    overflow: hidden;
}

    .login-left::before {
        content: '';
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
        transform: rotate(30deg);
    }*/

/*.login-right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background-color: var(--gs1-white);
}

.login-form-container {
    width: 100%;
    max-width: 500px;
}*/

/* Barcode Preview Box */
.barcode-preview-box {
    background-color: white;
    border: 1px dashed var(--gs1-border);
    border-radius: 8px;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    min-height: 250px;
}

/* Custom file upload */
.file-upload-wrapper {
    position: relative;
    width: 100%;
    height: 150px;
    border: 2px dashed var(--gs1-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background-color: var(--gs1-light-bg);
    cursor: pointer;
    transition: all 0.3s;
}

    .file-upload-wrapper:hover {
        border-color: var(--gs1-blue);
        background-color: rgba(0, 86, 164, 0.05);
    }

    .file-upload-wrapper input[type="file"] {
        position: absolute;
        width: 100%;
        height: 100%;
        opacity: 0;
        cursor: pointer;
    }

@media (max-width: 768px) {
    .sidebar {
        margin-left: -260px;
        position: fixed;
        height: 100vh;
        z-index: 1030;
    }

        .sidebar.active {
            margin-left: 0;
        }

    .main-content {
        width: 100%;
    }

    .login-left {
        display: none;
    }
}


.company-card {
    border-radius: 14px;
    border: 1px solid #eef2f7;
    transition: .25s;
    overflow: hidden;
}

    .company-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 25px rgba(0, 0, 0, .08);
    }

/* สำคัญสำหรับข้อความใน Flex */
.min-w-0 {
    min-width: 0;
}

.company-name,
.company-name-en {
    display: block;
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.company-icon {
    flex: 0 0 auto;
}

.icon-box {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #0056A4;
}

.components li.active a {
    background: #0056A4;
    color: white;
    border-radius: 8px;
}

.components li.active i {
    color: white;
}

.company-panel {
    color: white;
}

/* label */

.company-label {
    font-size: 12px;
    opacity: .7;
    letter-spacing: .4px;
}

/* company name */

.company-name {
    font-size: 15px;
    font-weight: 600;
}

.company-name-en {
    font-size: 12px;
    opacity: .7;
}

/* meta section */

.company-meta {
    display: flex;
    gap: 8px;
}

/* tag */

.company-tag {
    background: rgba(255,255,255,.12);
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 14px;
}

.tag-label {
    opacity: .7;
    margin-right: 4px;
}

.tag-value {
    font-weight: 600;
}

/* sidebar logo */

.sidebar-logo {
    height: 34px;
    width: auto;
}

/* title */

.sidebar-title {
    line-height: 1.1;
}

/* header */

.sidebar-header {
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,.15);
}


.lang-switch .nav-link {
    border-radius: 10px;
    padding: 8px 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .lang-switch .nav-link.active {
        background: #0056A4;
    }

.editor-box {
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    transition: all .2s;
}

    .editor-box:focus {
        border-color: #0056A4;
        box-shadow: 0 0 0 0.15rem rgba(0,86,164,.15);
    }

.card {
    border-radius: 14px;
}


/* ==============================
   Select2 inside info-box
   ให้หน้าตาเหมือน field อื่นใน card
   ============================== */

.info-box .select2-container {
    width: 100% !important;
    margin-top: 2px;
}

.info-box .select2-container--default .select2-selection--single {
    height: 44px;
    min-height: 44px;
    border-radius: 10px;
    border: 1px solid #dbe3ec;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    box-shadow: none;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

    .info-box .select2-container--default .select2-selection--single:hover {
        border-color: #b8c7d8;
    }

.info-box .select2-container--default.select2-container--focus .select2-selection--single,
.info-box .select2-container--default.select2-container--open .select2-selection--single {
    border-color: #0056A4;
    box-shadow: 0 0 0 .18rem rgba(0, 86, 164, .12);
}

.info-box .select2-container--default .select2-selection--single .select2-selection__rendered {
    padding-left: 12px;
    padding-right: 36px;
    color: #1e293b;
    font-size: 0.96rem;
    font-weight: 500;
    line-height: 44px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.info-box .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #94a3b8;
    font-weight: 500;
}

.info-box .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 44px;
    width: 32px;
    right: 6px;
}

.info-box .select2-container--default .select2-selection--single .select2-selection__clear {
    height: 44px;
    line-height: 42px;
    margin-right: 26px;
    color: #334155;
    font-size: 1.1rem;
    font-weight: 700;
}

/* Dropdown */
.select2-dropdown {
    border: 1px solid #dbe3ec;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 14px 32px rgba(15, 23, 42, .14);
}

.select2-container--default .select2-search--dropdown {
    padding: 10px;
    background: #f8fafc;
    border-bottom: 1px solid #e5eaf0;
}

    .select2-container--default .select2-search--dropdown .select2-search__field {
        height: 40px;
        border-radius: 10px;
        border: 1px solid #dbe3ec;
        padding: 8px 12px !important;
        font-size: 0.96rem;
        outline: none;
    }

        .select2-container--default .select2-search--dropdown .select2-search__field:focus {
            border-color: #0056A4;
            box-shadow: 0 0 0 .16rem rgba(0, 86, 164, .10);
        }

.select2-results__option {
    padding: 10px 12px;
    font-size: 0.96rem;
    line-height: 1.45;
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: #0056A4;
    color: #ffffff;
}

.select2-container--default .select2-results__option--selected {
    background-color: #eef5ff;
    color: #003f7d;
    font-weight: 600;
}

.table-box {
    border: 3px solid rgba(0, 86, 164, 0.2); /* ขอบนอกหนา */
    border-radius: 12px; /* มุมมน */
    overflow: hidden; /* ทำให้ table ไม่ทะลุ */
    background: #fff;
}

.text-gs1-blue {
    color: #0056A4;
}

.no-image {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    background: #f1f3f5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 10px;
    font-weight: 600;
}

    .no-image svg {
        /* width: 18px;
    height: 18px;*/
        margin-bottom: 2px;
    }

.card-header summary {
    list-style: none;
}

    .card-header summary::-webkit-details-marker {
        display: none;
    }

    .card-header summary::after {
        content: " ▼";
        font-size: 12px;
    }


.dropdown-divider {
    border: none;
    height: 1px;
    background: linear-gradient( to right, transparent, rgba(0, 86, 164, 0.25), transparent );
    margin: 0.5rem 0;
}

.avatar-fallback {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: #64748b;
}

.clickable-row {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

    .clickable-row:hover {
        background-color: #f8fbff;
    }

        .clickable-row:hover td:first-child {
            box-shadow: inset 3px 0 0 #0056a4;
        }

.two-line {
    display: -webkit-box;
    -webkit-line-clamp: 2; /* 👉 จำกัด 2 บรรทัด */
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-all; /* 👉 ตัดคำยาว ๆ (URL / GS1) */
}


/* ===== Sidebar Layout ===== */
.sidebar-wrapper {
    background: linear-gradient(180deg, #003D7A, #0056A4);
    height: 100%;
    padding: 0;
}

/* ===== Header ===== */
.sidebar-header-modern {
    padding: 18px 16px;
    background: radial-gradient(circle at top right, rgba(255,106,0,.35), transparent 35%), linear-gradient(135deg, #0056A4 0%, #003B73 100%);
    border-bottom: 1px solid rgba(255,255,255,.16);
}

.logo-box {
    width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .logo-box img {
        width: 80px;
    }

.portal-title {
    font-weight: 700;
    font-size: 15px;
    color: #FF6A00;
}

.portal-sub {
    font-size: 11px;
    color: rgba(255,255,255,0.7);
}

/* ===== Company Card ===== */
.company-card {
    margin: 12px;
    padding: 15px;
    border-radius: 10px;
    background: linear-gradient(160deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
    backdrop-filter: blur(10px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 10px 25px rgba(0,0,0,0.25);
    color: white;
}

/* ===== Company ===== */
.company-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}

.company-name {
    font-weight: 600;
    font-size: 15px;
}

.company-name-en {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
}

/* ===== Chips ===== */
.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.chip {
    display: flex;
    gap: 6px;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.15);
    font-size: 12px;
}

    .chip strong {
        font-weight: 600;
    }

.chip-outline {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
}

/* ===== GTIN ===== */
.gtin-card {
    background: linear-gradient(135deg, #FF6A00, #ff8c3a);
    border-radius: 16px;
    padding: 14px 16px;
    box-shadow: 0 8px 25px rgba(255,106,0,0.45);
    border-color: #FF6A00;
}

.gtin-label {
    font-size: 11px;
    opacity: 0.9;
}

.gtin-value {
    font-size: 16px;
    font-weight: 700;
}

.row-error-soft {
    /*background-color: #f26334;*/
    border-left: 10px solid #ff4d6d;
    border-right: 10px solid #ff4d6d;
}

.gtin-card2 {
    background: linear-gradient(135deg, #FF6A00, #ff8c3a);
    border-radius: 10px;
    padding: 5px;
    box-shadow: 0 8px 25px rgba(255,106,0,0.45);
    border-color: #FF6A00;
}


.product-image-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #dee2e6;
}

    /* หน้า List: 60 x 60 */
    .product-image-wrapper.image-list {
        width: 60px;
        height: 60px;
        flex: 0 0 60px;
        background: #fff;
    }

    /* หน้า Detail: เต็มความกว้าง */
    .product-image-wrapper.image-detail {
        width: 100%;
        min-height: 280px;
        aspect-ratio: 1 / 1;
    }

.product-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    z-index: 2;
}

.image-detail .product-image {
    object-fit: contain;
    background: #fff;
}

.product-image-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: #f5f6f8;
    color: #9ca3af;
    z-index: 1;
}

    .product-image-fallback i {
        font-size: 26px;
    }

    .product-image-fallback span {
        font-size: 9px;
        font-weight: 700;
    }

.image-detail .product-image-fallback i {
    font-size: 60px;
}

.image-detail .product-image-fallback span {
    font-size: 14px;
}


.gs1-table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
}

.gs1-table {
    width: 100%;
    min-width: 1100px;
}

    .gs1-table th,
    .gs1-table td {
        vertical-align: middle;
    }



.main-content {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page-content {
    flex: 1 0 auto;
}

.gs1-footer {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 24px;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    color: #64748b;
    font-size: 0.78rem;
}

.gs1-footer-content {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.gs1-footer-brand {
    color: #0056A4;
    font-weight: 800;
    white-space: nowrap;
}

.gs1-footer-divider {
    color: #F26334;
    font-weight: 800;
}

.gs1-footer-tagline {
    color: #475569;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.gs1-footer-copyright {
    color: #94a3b8;
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .gs1-footer {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        gap: 5px;
        padding: 12px 16px;
    }

    .gs1-footer-content {
        justify-content: center;
        flex-wrap: wrap;
    }

    .gs1-footer-copyright {
        font-size: 0.72rem;
    }
}



.process-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, .72);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.process-box {
    min-width: 240px;
    padding: 28px 32px;
    border-radius: 22px;
    background: #fff;
    text-align: center;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .15);
}

.process-spinner {
    width: 54px;
    height: 54px;
    margin: 0 auto 16px;
    border-radius: 50%;
    border: 5px solid #e5e7eb;
    border-top-color: #0d6efd;
    animation: spin .8s linear infinite;
}

.process-title {
    font-size: 18px;
    font-weight: 800;
    color: #172033;
}

.process-text {
    margin-top: 4px;
    color: #64748b;
    font-size: 14px;
}