/* ==========================================================
   style.css — Giao diện cổng đối tác Affiliate "Đam Mê Xế Cưng"
   Nền tảng: Bootstrap 5. File này chỉ chứa phần tùy biến.
   Mục lục: xem các tiêu đề đánh số bên dưới.
   ========================================================== */

/* ---------- 1. Biến màu (đổi màu thương hiệu tại đây) ---------- */

:root {
    --or: #f97316;
    --or2: #ea580c;
    --navy: #14253d;
    --bg: #f6f8fb;
    --line: #e8ecf2;
    --tx: #1b2433;
    --mut: #6b7686;
}

/* ---------- 2. Nền tảng ---------- */

.body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; /* font hệ thống (trước: 'Be Vietnam Pro') */
    background: var(--bg);
    color: var(--tx);
    font-size: 14px;
}

.text-or {
    color: var(--or) !important;
}

/* ---------- 3. Nút bấm & ô nhập liệu ---------- */

.btn-or {
    background: var(--or);
    color: #fff;
    border: 0;
    font-weight: 600;
    border-radius: 8px;
}

.btn-or:hover {
    background: var(--or2);
    color: #fff;
}

.btn-line {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--tx);
}

.btn-line:hover {
    border-color: var(--or);
    color: var(--or);
}

input.form-control[readonly] {
    background: #ddd;
    cursor: no-drop;
}

.form-control,
.form-select {
    border-radius: 8px!important;
    border-color: var(--line);
    font-size: 13px!important;
    /* padding: .55rem .75rem!important; */
}

.form-control:focus,
.form-select:focus {
    border-color: var(--or);
    box-shadow: 0 0 0 .2rem rgba(249, 115, 22, .15);
}

.form-check-input:checked {
    background-color: var(--or);
    border-color: var(--or);
}

a {
    color: var(--or2);
}

/* ---------- 4. Logo ---------- */

.logo {
    text-align: center;
    line-height: 1.1;
}

.logo i {
    display: block;
    font-size: 26px;
    color: var(--or);
    margin-bottom: -4px;
}

.logo b {
    font-weight: 800;
    font-style: italic;
    font-size: 19px;
    letter-spacing: .3px;
}

.logo small {
    display: block;
    font-size: 11px;
    opacity: .85;
}

/* ---------- 5. Trang đăng nhập / đăng ký ---------- */

.auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, #eef2f8, #dfe6f0);
}

.auth-box {
    display: flex;
    max-width: 1000px;
    width: 100%;
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(20, 37, 61, .15);
}

.auth-l {
    flex: 1;
    padding: 36px;
    background: linear-gradient(160deg, #fff 40%, #fde8d6);
    display: flex;
    flex-direction: column;
    gap: 18px;
    justify-content: center;
}

.auth-l h1 {
    font-weight: 800;
    font-size: 34px;
    line-height: 1.2;
}

.auth-l ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.auth-l li {
    margin: 8px 0;
}

.auth-l li i {
    color: var(--or);
    margin-right: 8px;
}

.auth-r {
    flex: 1.1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ig {
    position: relative;
}

.ig>i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--mut);
}

.ig .form-control,
.ig .form-select {
    padding-left: 36px;
}

@media (max-width: 768px) {
    .auth-box {
        flex-direction: column;
    }

    .auth-l {
        display: none;
    }

    .auth-r {
        padding: 24px;
    }

}

/* ---------- 6. Khung giao diện: sidebar + thanh trên ---------- */

.side {
    position: fixed;
    inset: 0 auto 0 0;
    width: 240px;
    background: linear-gradient(180deg, var(--navy) 55%, #0e1a2d);
    color: #fff;
    padding: 20px 12px;
    z-index: 100;
    transition: .25s;
    overflow: auto;
}

.side .logo {
    color: #fff;
    margin-bottom: 26px;
}

.side a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #e6ecf5;
    text-decoration: none;
    padding: 11px 14px;
    border-radius: 9px;
    margin-bottom: 4px;
}

.side a i {
    font-size: 18px;
}

.side a:hover {
    background: rgba(255, 255, 255, .08);
}

.side a.on {
    background: var(--or);
    color: #fff;
    font-weight: 600;
}

.main {
    margin-left: 240px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top {
    height: 64px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.top .menu {
    font-size: 24px;
    background: none;
    border: 0;
}

.av {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #cfd6e2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.content {
    padding: 24px;
}

/* ---------- 7. Tiêu đề trang & thẻ thống kê ---------- */

.ptitle {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.ptitle .ic {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #fff1e6;
    color: var(--or);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.ptitle h2 {
    font-weight: 800;
    font-size: 24px;
    margin: 0;
}

.ptitle p {
    margin: 0;
    color: var(--mut);
}

.stat {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border-radius: 12px;
    border: 1px solid var(--line);
    height: 100%;
}

.stat .ic {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.stat small {
    display: block;
    color: var(--tx);
}

.stat b {
    font-size: 24px;
    font-weight: 800;
}

.s-or {
    background: #fff4ec;
}

.s-or .ic {
    color: var(--or);
}

.s-bl {
    background: #eef5ff;
}

.s-bl .ic {
    color: #2f6fed;
}

.s-gr {
    background: #eefaf1;
}

.s-gr .ic {
    color: #16a34a;
}

.s-pu {
    background: #f4f1ff;
}

.s-pu .ic {
    color: #7c4dff;
}

/* ---------- 8. Bảng dữ liệu ---------- */

.cardx {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
}

.cardx .table {
    margin: 0;
}

.table thead th {
    background: #f3f5f9;
    font-size: 13px;
    font-weight: 700;
    padding: 12px;
    white-space: nowrap;
}

.table td {
    padding: 12px;
    vertical-align: middle;
    font-size: 13px;
}

.thumb {
    width: 42px;
    height: 30px;
    border-radius: 5px;
    background: linear-gradient(135deg, #222, #555);
    border-bottom: 3px solid var(--or);
    flex: none;
}

/* ---------- 9. Badge trạng thái, chip lọc, phân trang ---------- */

.bd {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.bd-w {
    background: #ffe9d9;
    color: var(--or2);
}

.bd-g {
    background: #dcf5e3;
    color: #15803d;
}

.bd-b {
    background: #dceafe;
    color: #1d4ed8;
}

.bd-r {
    background: #fde2e2;
    color: #b91c1c;
}

.chip {
    padding: 7px 14px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
}

.chip.on {
    background: var(--or);
    color: #fff;
    border-color: var(--or);
}

.pg .page-link {
    color: var(--tx);
    border: 1px solid var(--line);
    margin: 0 3px;
    border-radius: 7px !important;
}

.pg .active .page-link {
    background: var(--or);
    border-color: var(--or);
    color: #fff;
}

/* ---------- 10. Thẻ sản phẩm ---------- */

.pc {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.pc .img {
    /* Ảnh vuông, hiện đủ cả ảnh (không cắt) */
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #fff;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--or);
    font-size: 44px;
    border-bottom: 4px solid var(--or);
}

.pc .tag {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--or);
    color: #fff;
    font-size: 12px;
    padding: 2px 10px;
    border-radius: 6px;
}

.pc .bd2 {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pc .img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.pc h6 {
    font-weight: 700;
    min-height: 40px;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.price b {
    color: var(--or2);
    font-size: 17px;
    font-weight: 800;
}

.price s {
    color: var(--mut);
    margin: 0 6px;
    font-size: 12px;
}

.price span {
    background: #ffe9d9;
    color: var(--or2);
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 5px;
}

.hh {
    background: #eefaf1;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 13px;
}

/* ---------- 13. Responsive (điện thoại / máy tính bảng) ---------- */

@media (max-width: 992px) {
    .side {
        transform: translateX(-100%);
    }

    .side.open {
        transform: none;
    }

    .main {
        margin-left: 0;
    }

}

/* ---------- 12. Khối trang trí trang đăng ký ---------- */

.car {
    position: relative;
    min-height: 250px;
}

.car-img {
    position: absolute;
    inset: 20px 40% 0 0;
    border-radius: 14px;
    background: linear-gradient(135deg, #222, #555);
    border-bottom: 5px solid var(--or);
    display: grid;
    place-items: center;
    color: var(--or);
    font-size: 54px;
}

.fcs {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 62%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
}

.fc {
    display: flex;
    gap: 12px;
    align-items: center;
    background: rgba(255, 255, 255, .95);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 14px;
    box-shadow: 0 6px 16px rgba(20, 37, 61, .1);
}

.fc b {
    display: block;
    font-size: 13px;
}

.fc small {
    display: block;
    color: var(--mut);
    font-size: 12px;
}

.fi {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--or);
    color: var(--or);
    display: grid;
    place-items: center;
    flex: none;
}

@media (max-width: 576px) {
    .auth-r .row>[class*=col-md] {
        width: 100%;
    }

}

/* ---------- 11. Biểu đồ cột (Tổng quan) ---------- */

.bar-col {
    flex: 1;
    text-align: center;
    font-size: 12px;
}

.bar-fill {
    background: var(--or);
    border-radius: 6px 6px 0 0;
    margin: 4px 0;
}

.bg-or {
    background-color: var(--or) !important;
}


.form-control, .form-select{
    min-height: 40px;
}

.loading-page {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.96);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 55px;
    height: 55px;
    border: 5px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: loadingRotate 0.8s linear infinite;
    margin: 0 auto 20px;
}

.loading-content h3 {
    font-size: 18px;
    font-weight: 600;
    color: #222;
    margin: 0 0 8px;
}

.loading-content p {
    font-size: 14px;
    color: #888;
    margin: 0;
}

@keyframes loadingRotate {
    to {
        transform: rotate(360deg);
    }
}

/* Logo + tiêu đề trang đăng nhập/đăng ký: gọn trên 1 dòng */
.auth-l .logo { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 8px; text-align: left; }
.auth-l .logo i { display: inline-block; margin: 0; font-size: 26px; line-height: 1; }
.auth-l .logo b { white-space: nowrap; }
.auth-l .logo small { flex-basis: 100%; }
.auth-l h1 { font-size: 26px !important; white-space: nowrap; }
.auth-l h1 .text-or { display: inline; }
@media (max-width: 575px) { .auth-l h1 { white-space: normal; font-size: 24px !important; } }

/* Nút về trang chủ trên trang đăng nhập / đăng ký / quên mật khẩu */
.auth { position: relative; flex-direction: column; gap: 14px; }
.auth-home { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; background: #fff; color: #1f2329 !important; text-decoration: none; font-weight: 600; font-size: 14px; padding: 8px 16px; border-radius: 999px; box-shadow: 0 2px 10px rgba(17, 24, 39, .08); transition: background .2s, color .2s, transform .2s; }
.auth-home:hover { background: var(--or); color: #fff !important; transform: translateX(-3px); }
@media (min-width: 1200px) { .auth-home { position: absolute; top: 22px; left: 26px; } }
a.logo, a.logo:hover { color: inherit; text-decoration: none; }
.auth-r .alert a { font-weight: 700; }

/* ---------- Đăng nhập / Đăng ký / Quên mật khẩu trên điện thoại ---------- */
@media (max-width: 768px) {
    .auth { padding: 12px 12px 24px; justify-content: flex-start; min-height: 100vh; gap: 10px; }
    .auth-box { border-radius: 16px; max-width: 100% !important; }
    .auth-l { display: flex !important; padding: 18px 18px 14px; gap: 8px; flex: none !important; background: linear-gradient(135deg, #fff 45%, #fde8d6); }
    .auth-l > p, .auth-l > ul, .auth-l .car { display: none !important; }
    .auth-l .logo b { font-size: 17px; }
    .auth-l h1 { font-size: 22px !important; margin: 4px 0 0 !important; white-space: normal; }
    .auth-r { padding: 18px 16px 22px; flex: none !important; }
    .auth-r h3 { font-size: 20px; margin-bottom: 14px !important; }
    .auth-r .form-control, .auth-r .form-select { font-size: 16px; min-height: 46px; } /* 16px: iPhone không tự phóng to khi nhập */
    .auth-r .form-label { font-size: 14px; margin-bottom: 4px; }
    .auth-r .btn-or { min-height: 48px; font-size: 16px; }
    .auth-r .row { --bs-gutter-y: .75rem; }
    .auth-r .d-flex.justify-content-between { font-size: 14px; }
    .auth-home { padding: 7px 14px; font-size: 13.5px; }
    .auth-r .addr-v2 select { font-size: 16px; min-height: 46px; }
}

/* ---------- Trang Link tiếp thị (responsive) ---------- */
.lk-make { padding: 18px 20px; }
.lk-code { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; background: #fff7ef; border: 1px dashed #fdba74; border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; }
.lk-code span { color: var(--mut); font-size: 14px; }
.lk-code b { font-size: 18px; letter-spacing: .5px; }
.lk-code .btn { margin-left: auto; }
.lk-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 10px; }
.lk-url { display: flex; min-width: 0; }
.lk-url .form-control { border-top-right-radius: 0; border-bottom-right-radius: 0; min-width: 0; background: #f8fafc; font-size: 14px; }
.lk-url .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; white-space: nowrap; flex-shrink: 0; }
.lk-note { margin: 10px 0 0; font-size: 13px; color: var(--mut); line-height: 1.6; }
.lk-note code { word-break: break-all; }
.lk-list { overflow: hidden; }
.lk-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid #eef0f3; }
.lk-search { width: 240px; max-width: 100%; }
.lk-cols, .lk-item { display: grid; grid-template-columns: minmax(0, 1fr) 90px 90px 170px; gap: 12px; align-items: center; padding: 12px 18px; }
.lk-cols { padding-top: 10px; padding-bottom: 10px; background: #f8fafc; font-size: 12.5px; font-weight: 700; color: var(--mut); text-transform: uppercase; }
.lk-cols span:nth-child(2), .lk-cols span:nth-child(3) { text-align: center; }
.lk-item { border-top: 1px solid #f1f3f5; transition: background .15s; }
.lk-item:hover { background: #fffaf5; }
.lk-prod { display: flex; align-items: center; gap: 12px; min-width: 0; }
.lk-thumb { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: #f1f3f5; flex-shrink: 0; display: block; }
.lk-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lk-info b { font-size: 14.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lk-link { font-size: 12.5px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lk-stat { text-align: center; }
.lk-stat small { display: none; color: var(--mut); font-size: 12px; }
.lk-stat b { font-size: 15px; }
.lk-act { display: flex; gap: 6px; justify-content: flex-end; }
.lk-act .btn { white-space: nowrap; }
@media (max-width: 768px) {
    .lk-make { padding: 14px; }
    .lk-row { grid-template-columns: 1fr; }
    .lk-url .btn span { display: none; }
    .lk-code b { font-size: 16px; }
    .lk-head { padding: 12px 14px; }
    .lk-search { width: 100%; }
    .lk-cols { display: none; }
    .lk-item { grid-template-columns: auto auto minmax(0, 1fr); grid-template-areas: "prod prod prod" "click order act"; gap: 10px; padding: 12px 14px; }
    .lk-prod { grid-area: prod; }
    .lk-item .lk-stat:nth-of-type(2) { grid-area: click; }
    .lk-item .lk-stat:nth-of-type(3) { grid-area: order; }
    .lk-act { grid-area: act; }
    .lk-stat { display: flex; align-items: baseline; gap: 5px; background: #f8fafc; border-radius: 8px; padding: 5px 10px; }
    .lk-stat small { display: inline; }
    .lk-stat b { font-size: 14px; }
    .lk-thumb { width: 48px; height: 48px; }
}
@media (max-width: 380px) { .lk-act .btn span { display: none; } }
