:root {
    --bg: #07111b;
    --bg-soft: #0d1724;
    --panel: rgba(255, 255, 255, 0.05);
    --panel-strong: rgba(255, 255, 255, 0.08);
    --text: #f5f7fb;
    --muted: rgba(245, 247, 251, 0.68);
    --line: rgba(255, 255, 255, 0.10);
    --line-strong: rgba(255, 255, 255, 0.16);
    --primary: #2563eb;
    --secondary: #4f46e5;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.30);
    --radius: 22px;
    --radius-sm: 14px;
    --container: 1200px;
}


/* =========================
   Affiliate Products Theme
========================= */

body {
    background: #f3f6fb;
    color: #1f2937;
    font-family: "Segoe UI", Arial, sans-serif;
}

/* page */
.page-header {
    margin: 18px 0 20px 0;
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    border: 0;
}

/* toolbar */


.action-toolbar .btn, .button_set  .btn {
    border-radius: 10px;
    font-weight: 600;
    padding: 10px 16px;
    border: 0;
    transition: all 0.2s ease;
}

.btn-primary {
    border: none;
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 12px 30px rgba(77, 166, 255, 0.18);
}

.action-toolbar .btn-primary:hover,
.action-toolbar .btn-primary:focus {
    opacity: 0.95;
    transform: translateY(-1px);
}

/* search panel */
#search_tool {
    display: block;
    margin-bottom: 20px;
    padding: 20px 18px 8px 18px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

#search_tool .form-group {
    margin-bottom: 14px;
}

#search_tool .form-control {
    height: 42px;
    border-radius: 12px;
    border: 1px solid #d1d5db;
    box-shadow: none;
    font-size: 14px;
    color: #111827;
}

#search_tool .form-control:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.10);
}

#search_tool .btn {
    height: 42px;
    min-width: 120px;
    border-radius: 12px;
    border: 0;
    font-weight: 700;
    color: #ffffff;
}

#search_tool .btn:hover,
#search_tool .btn:focus {
    opacity: 0.95;
}

/* result wrapper */
#search_result {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    padding: 0;
}

/* empty state */
#search_result > p.tx_center {
    margin: 0;
    padding: 40px 20px;
    color: #6b7280;
    font-size: 15px;
    text-align: center;
}

/* table */
#search_result .table {
    margin-bottom: 0;
    border: 0;
}

#search_result .table > thead > tr > th {
    background: #f8fafc;
    color: #4b5563;
    border-bottom: 1px solid #e5e7eb;
    border-top: 0;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    vertical-align: middle;
    padding: 14px 12px;
}

#search_result .table > tbody > tr > td {
    border-top: 0;
    border-bottom: 1px solid #eef1f4;
    vertical-align: middle;
    padding: 14px 12px;
    font-size: 14px;
    color: #111827;
    background: #ffffff;
}

#search_result .table > tbody > tr:hover > td {
    background: #f9fbff;
}

/* product cell */
.word_wrap {
    word-break: break-word;
}

.tx_left {
    text-align: left;
}

.tx_center {
    text-align: center;
}

/* image */
#sku_image,
.thumbnail_popup_click_min,
.thumbnail_popup_click {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    margin-bottom: 10px;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.05);
    cursor: pointer;
}

/* product title */
#search_result .table td .product-name,
#search_result .table td div {
    line-height: 1.5;
}

/* stock statuses */
.stock-out {
    color: #dc2626;
    font-weight: 700;
}

.stock-mto {
    color: #2563eb;
    font-weight: 700;
}

.stock-dropship {
    color: #111827;
    font-weight: 700;
}

/* commission emphasis */
#search_result .table td:nth-child(4),
#search_result .table td:nth-child(5),
#search_result .table td:nth-child(6),
#search_result .table td:nth-child(7) {
    font-weight: 600;
}

/* popup */
#thumbnail_popup {
    padding: 12px;
}

#thumbnail_image {
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.10);
}

/* helper */
.none_padding {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.noneAppear {
    display: none !important;
}

/* custom red text tag fallback */
redtext {
    color: #dc2626;
    font-weight: bold;
}

/* responsive */
@media (max-width: 991px) {
    .action-toolbar {
        padding: 14px;
    }

    #search_tool {
        padding: 16px 14px 6px 14px;
    }

    #search_result {
        overflow-x: auto;
    }

    #search_result .table {
        min-width: 900px;
    }
}

@media (max-width: 767px) {
    .page-header {
        font-size: 24px;
    }

    .action-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .action-toolbar .btn {
        width: 100%;
    }

    #sku_image,
    .thumbnail_popup_click_min,
    .thumbnail_popup_click {
        width: 60px;
        height: 60px;
    }
}
												
												
												.navbar-inverse {
    background-color: #00254d;
    border-color: #080808;
}

.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    background: rgba(7, 17, 27, 0.72);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.navbar_bg {
    margin: 0;
    font-family: 'Inter', 'Prompt', sans-serif;
    color: var(--text);
    background: radial-gradient(circle at top left, rgba(77, 166, 255, 0.16), transparent 28%), radial-gradient(circle at 85% 18%, rgba(124, 92, 255, 0.12), transparent 24%), linear-gradient(180deg, #081018 0%, #09131e 40%, #091320 100%);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* =========================
   Metasanova Header Upgrade
========================= */

.navbar_bg {
    position: sticky;
    top: 0;
    z-index: 1100;
    background:
        radial-gradient(circle at 12% 0%, rgba(37, 99, 235, 0.22), transparent 34%),
        radial-gradient(circle at 85% 10%, rgba(79, 70, 229, 0.18), transparent 30%),
        linear-gradient(180deg, rgba(7, 17, 27, 0.96), rgba(9, 19, 32, 0.92));
    border-bottom: 1px solid rgba(255,255,255,0.10);
    box-shadow: 0 14px 40px rgba(0,0,0,0.28);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

/* ลดปัญหา navbar ซ้อนกัน */
.navbar_bg header.navbar,
.navbar_bg nav.navbar {
    margin-bottom: 0;
    border: 0;
    min-height: auto;
}

/* Top user area */
#header {
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #f5f7fb;
}

#logo {
    margin: 0;
    width: 180px;
    height: 34px;
    position: relative;
}

#logo:before {
    content: "METASANOVA";
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1.8px;
    color: #ffffff;
    background: linear-gradient(135deg, rgba(37,99,235,0.95), rgba(79,70,229,0.95));
    box-shadow: 0 10px 28px rgba(37,99,235,0.28);
}

/* Welcome */
#user_console {
    margin: 0;
    list-style: none;
}

#user_console > li > a {
    color: rgba(245,247,251,0.82);
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
    text-decoration: none;
    transition: all 0.2s ease;
}

#user_console > li > a:hover,
#user_console > li.open > a {
    color: #ffffff;
    background: rgba(255,255,255,0.10);
}

#welcome {
    color: #ffffff;
    font-weight: 700;
}

/* Main nav */
.navbar_bg .navbar-inverse {
    background: transparent;
    border: 0;
}

.navbar_bg .navbar-brand {
    color: #ffffff !important;
    font-weight: 800;
    padding: 16px 18px;
    border-radius: 14px;
}

.navbar_bg .navbar-nav > li > a {
    color: rgba(245,247,251,0.72) !important;
    font-weight: 700;
    padding: 16px 14px;
    margin: 4px 2px;
    border-radius: 14px;
    transition: all 0.2s ease;
}

.navbar_bg .navbar-nav > li > a:hover, .navbar_bg .navbar-nav > li.active > a, .navbar_bg .navbar-nav > li.open > a {
    color: #ffffff !important;
    /* background: rgba(255, 255, 255, 0.08) !important; */
    /* box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); */
}

/* Active glow */
.navbar_bg .navbar-nav > li.active > a:after {
    content: "";
    display: block;
    height: 3px;
    margin-top: 8px;
    border-radius: 999px;
}

/* Dropdown */
.navbar_bg .dropdown-menu {
    margin-top: 8px;
    padding: 8px;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 16px;
    background: rgba(13, 23, 36, 0.96);
    box-shadow: 0 18px 50px rgba(0,0,0,0.35);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.navbar_bg .dropdown-menu > li > a {
    color: rgba(245,247,251,0.78);
    padding: 10px 12px;
    border-radius: 12px;
    font-weight: 600;
}

.navbar_bg .dropdown-menu > li > a:hover {
    color: #ffffff;
    background: rgba(37,99,235,0.18);
}

/* Mobile */
.navbar_bg .navbar-toggle {
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 12px;
    background: rgba(255,255,255,0.06);
}

.navbar_bg .navbar-toggle .icon-bar {
    background: #ffffff;
}

@media (max-width: 767px) {
    #header {
        padding: 10px 0;
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    #logo {
        width: auto;
    }

    #user_console > li > a {
        display: inline-block;
    }

    .navbar_bg .navbar-nav > li > a {
        margin: 4px 0;
    }
}

/* =========================
   Nav underline (เหมือน Home)
========================= */

.navbar_bg .navbar-nav > li > a {
    position: relative;
    color: rgba(245, 247, 251, 0.72) !important;
    font-weight: 700;
    padding: 16px 14px;
    font-size: 14px;
}
/* เส้นด้านล่าง */
.navbar_bg .navbar-nav > li > a::after {
    content: "";
    position: absolute;
    left: 12px;
    bottom: 6px;
    width: 0;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, #4da6ff, #7c5cff);
    transition: width 0.28s ease;
}

/* hover */
.navbar_bg .navbar-nav > li > a:hover::after {
    width: calc(100% - 24px);
}

/* active ค้างไว้ */
.navbar_bg .navbar-nav > li.active > a::after {
    width: calc(100% - 24px);
}

/* =========================
   Global Form / Invoice Theme
========================= */

.form-control {
    height: 42px;
    border-radius: 12px;
    border: 1px solid #d1d5db;
    box-shadow: none;
    font-size: 14px;
    color: #111827;
    background: #ffffff;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.form-control[disabled],
.form-control[readonly] {
    background: #f8fafc;
    color: #6b7280;
}

.btn {
    border-radius: 12px;
    font-weight: 700;
    border: 0;
    transition: all 0.2s ease;
}

.btn-primary:hover,
.btn-primary:focus {
    opacity: 0.96;
    transform: translateY(-1px);
    box-shadow: 0 14px 34px rgba(79, 70, 229, 0.28);
}

/* page header underline */
.page-header {
    position: relative;
    padding-bottom: 10px;
}

.page-header:after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 86px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

/* all normal bootstrap tables */
.table {
    background: #ffffff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
    border: 1px solid #e5e7eb;
}

.table > thead > tr > th {
    background: #f8fafc;
    color: #4b5563;
    border-bottom: 1px solid #e5e7eb;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.25px;
    vertical-align: middle;
    padding: 13px 12px;
}

.table > tbody > tr > td,
.table > tfoot > tr > td,
.table > tfoot > tr > th {
    border-color: #eef1f4;
    vertical-align: middle;
    padding: 12px;
    color: #111827;
    background: #ffffff;
}

.table-striped > tbody > tr:nth-of-type(odd) > td {
    background-color: #fbfdff;
}

.table > tbody > tr:hover > td {
    background: #f9fbff;
}

/* invoice total */
#bill_total_span,
#grand_total_span {
    font-weight: 800;
}

#grand_total_span {
    font-size: 22px;
    color: var(--secondary);
}

/* thumbnail */
.img-thumbnail,
.thumbnail_popup_click_min,
.thumbnail_popup_click {
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

/* alert message */
span.pass {
    color: #047857 !important;
    border: 1px solid rgba(16, 185, 129, 0.35) !important;
    background: rgba(16, 185, 129, 0.10) !important;
    border-radius: 12px;
    font-weight: 700;
}

span.fail {
    color: #dc2626 !important;
    border: 1px solid rgba(220, 38, 38, 0.28) !important;
    background: rgba(220, 38, 38, 0.08) !important;
    border-radius: 12px;
    font-weight: 700;
}

#navbar-route {
    margin: 10px 0;
}

#loading img {
    width: 100%;
}

#loading {
    margin: 50px auto 0px;
}

.page-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin: 25px 0;
}

.page-header-row .page-header {
    margin: 0;
    padding: 0 0 10px;
    border-bottom: none;
}

.action-toolbar {
    display: flex;
    align-items: center;
    /* gap: 8px; */
    flex-wrap: wrap;
}
