/**
 * Thương Hội (thuonghoi.php) - 28/10/2026. Bố cục kiểu Thương Hội trong game: biển hiệu, danh mục bên trái,
 * sổ hàng bên phải. Nút / nhãn trạng thái / biểu mẫu dùng lại sangd.css, napcard.css, ctv.css.
 * Màu lấy từ biến --h-* của body.portal-home (portal.css).
 */

.portal-sub .th-card {
    padding-top: 24px;
}

/* Biển hiệu */
.portal-sub .th-bang {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    margin-bottom: 16px;
    padding: 16px 22px;
    color: var(--h-cream);
    background:
        linear-gradient(180deg, rgba(255, 215, 122, 0.08), transparent 40%),
        linear-gradient(180deg, #5a1810, #2b0d08);
    border: 2px solid var(--h-gold);
    border-radius: 3px;
    box-shadow: inset 0 0 0 4px #2b0d08, inset 0 0 0 5px rgba(201, 154, 70, 0.55), 0 6px 16px rgba(0, 0, 0, 0.25);
}

.portal-sub .th-bang-chu {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.portal-sub .th-bang-ten {
    font-family: var(--h-serif);
    font-size: 30px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: 3px;
    color: var(--h-gold-hi);
    text-shadow: 0 2px 0 #2b0d08, 0 0 14px rgba(255, 215, 122, 0.25);
}

.portal-sub .th-bang-phu {
    font-size: 12.5px;
    letter-spacing: 1px;
    color: #e0c99a;
}

.portal-sub .th-tui {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: 13px;
}

.portal-sub .th-tui b {
    color: var(--h-gold-hi);
}

.portal-sub .th-tui a {
    margin-left: 4px;
    color: var(--h-gold-hi);
    text-decoration: underline;
}

.portal-sub .th-tui i {
    margin-right: 4px;
    color: var(--h-gold);
}

.portal-sub .th-tui-phieu {
    font-weight: 700;
    color: #ffb3a8;
}

/* Thẻ chọn mục */
.portal-sub .th-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--h-maroon);
}

.portal-sub .th-tabs a {
    padding: 8px 16px;
    font-family: var(--h-serif);
    font-size: 14px;
    font-weight: 700;
    color: var(--h-paper-text);
    text-decoration: none;
    background: rgba(201, 154, 70, 0.14);
    border: 1px solid rgba(201, 154, 70, 0.5);
    border-bottom: 0;
    border-radius: 3px 3px 0 0;
}

.portal-sub .th-tabs a:hover {
    color: var(--h-red);
}

.portal-sub .th-tabs a.on {
    color: var(--h-gold-hi);
    background: linear-gradient(180deg, var(--h-red), var(--h-maroon));
    border-color: var(--h-maroon);
}

.portal-sub .th-tabs a i {
    margin-right: 5px;
}

/* Quầy hàng: danh mục + sổ hàng */
.portal-sub .th-cho {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.portal-sub .th-dm {
    display: flex;
    flex-direction: column;
    padding: 8px;
    background: linear-gradient(180deg, #2a1c15, var(--h-ink));
    border: 1px solid var(--h-wood-line);
    border-radius: 3px;
}

.portal-sub .th-dm-dau {
    margin: 2px 4px 8px;
    padding-bottom: 6px;
    font-family: var(--h-serif);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--h-gold);
    text-transform: uppercase;
    border-bottom: 1px solid rgba(201, 154, 70, 0.3);
}

.portal-sub .th-dm a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    font-size: 13.5px;
    color: var(--h-cream);
    text-decoration: none;
    border-left: 3px solid transparent;
}

.portal-sub .th-dm a i {
    width: 16px;
    text-align: center;
    color: var(--h-gold);
}

.portal-sub .th-dm a em {
    margin-left: auto;
    font-style: normal;
    font-size: 12px;
    color: #9c8a6c;
}

.portal-sub .th-dm a:hover {
    background: rgba(201, 154, 70, 0.1);
}

.portal-sub .th-dm a.on {
    color: var(--h-gold-hi);
    background: rgba(179, 32, 26, 0.35);
    border-left-color: var(--h-gold-hi);
}

.portal-sub .th-loc {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 190px auto;
    gap: 8px;
    margin-bottom: 10px;
}

/* Sổ hàng */
.portal-sub .th-so {
    overflow: hidden;
    background: linear-gradient(180deg, #2a1c15, var(--h-ink));
    border: 1px solid var(--h-wood-line);
    border-radius: 3px;
}

.portal-sub .th-so-dau,
.portal-sub .th-dong {
    display: grid;
    grid-template-columns: minmax(0, 2.4fr) 70px minmax(0, 1.4fr) 150px;
    gap: 12px;
    align-items: center;
    padding: 10px 14px;
}

.portal-sub .th-so-dau {
    font-family: var(--h-serif);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--h-gold);
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(201, 154, 70, 0.35);
}

.portal-sub .th-dong {
    color: var(--h-cream);
    border-bottom: 1px solid rgba(201, 154, 70, 0.14);
}

.portal-sub .th-dong:last-child {
    border-bottom: 0;
}

.portal-sub .th-dong:hover {
    background: rgba(201, 154, 70, 0.07);
}

.portal-sub .th-dong-hang {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}

.portal-sub .th-dong-ico {
    flex: 0 0 34px;
    height: 34px;
    line-height: 32px;
    text-align: center;
    font-size: 15px;
    color: var(--h-gold-hi);
    background: radial-gradient(circle at 50% 35%, #4a2a1a, #1d1410);
    border: 1px solid var(--h-gold);
    border-radius: 3px;
}

/* Icon that cua vat pham (anh 64px cat tu client) */
.portal-sub img.th-dong-ico {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    padding: 0;
    object-fit: cover;
    background: #1d1410;
    border: 1px solid var(--h-gold);
    border-radius: 3px;
    box-shadow: 0 0 0 1px #1d1410, 0 2px 6px rgba(0, 0, 0, 0.45);
}

.portal-sub .th-o-hang {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.portal-sub .th-ico-nho {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    line-height: 26px;
    text-align: center;
    font-size: 13px;
    color: var(--h-gold-hi);
    object-fit: cover;
    background: #1d1410;
    border: 1px solid var(--h-gold);
    border-radius: 3px;
}

.portal-sub .th-dong-hang b {
    display: block;
    font-family: var(--h-serif);
    font-size: 14.5px;
    color: var(--h-gold-hi);
    overflow-wrap: anywhere;
}

.portal-sub .th-dong-hang small {
    display: block;
    font-size: 12px;
    color: #bfae8c;
    overflow-wrap: anywhere;
}

.portal-sub .th-dong-hang small.th-ma {
    color: #8a7a5e;
}

.portal-sub .th-dong-sl {
    font-weight: 700;
}

.portal-sub .th-dong-gia {
    font-size: 13.5px;
    line-height: 1.5;
}

.portal-sub .th-dong-gia .sgd-hoac {
    display: block;
    margin: 0;
    font-size: 11px;
}

.portal-sub .th-dong-chu {
    font-size: 13px;
    color: #e0c99a;
    overflow-wrap: anywhere;
}

.portal-sub .th-dong-mua {
    display: grid;
    gap: 6px;
}

.portal-sub .th-dong-mua .sgd-btn {
    padding-top: 6px;
    padding-bottom: 6px;
    font-size: 12.5px;
}

.portal-sub .th-nhan {
    display: none;
}

.portal-sub .th-trong {
    margin: 0;
    padding: 28px 14px;
    text-align: center;
    color: #bfae8c;
}

.portal-sub .th-trong a {
    color: var(--h-gold-hi);
}

/* Ô tài khoản ngân hàng trong biểu mẫu ký gửi: luôn hiện */
.portal-sub fieldset.sgd-nh {
    margin: 14px 0 0;
    min-width: 0;
}

.portal-sub fieldset.sgd-nh legend {
    width: auto;
    margin: 0;
    padding: 0 6px;
    font-family: var(--h-serif);
    font-size: 13px;
    font-weight: 700;
    color: var(--h-gold-hi);
}

.portal-sub .mt-0 {
    margin-top: 0;
}

@media (max-width: 991.98px) {
    .portal-sub .th-cho {
        grid-template-columns: 1fr;
    }

    .portal-sub .th-dm {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4px;
    }

    .portal-sub .th-dm-dau {
        display: none;
    }

    .portal-sub .th-dm a {
        padding: 6px 10px;
        border-left: 0;
        border: 1px solid rgba(201, 154, 70, 0.3);
    }

    .portal-sub .th-dm a em {
        margin-left: 4px;
    }
}

@media (max-width: 767.98px) {
    .portal-sub .th-bang-ten {
        font-size: 24px;
    }

    .portal-sub .th-loc {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .portal-sub .th-loc select {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .portal-sub .th-so-dau {
        display: none;
    }

    .portal-sub .th-dong {
        grid-template-columns: 1fr 1fr;
        gap: 8px 12px;
    }

    .portal-sub .th-dong-hang,
    .portal-sub .th-dong-gia,
    .portal-sub .th-dong-mua {
        grid-column: 1 / -1;
    }

    .portal-sub .th-nhan {
        display: block;
        font-size: 11px;
        font-weight: 400;
        color: #8a7a5e;
    }

    .portal-sub .th-tabs a {
        flex: 1 1 calc(33.333% - 4px);
        padding: 8px 6px;
        font-size: 12.5px;
        text-align: center;
    }
}

/* ===== 28/10/2026: mô hình cửa hàng (Đại Chưởng Quầy) ===== */
.portal-sub .th-loc--ch {
    grid-template-columns: minmax(0, 1fr) auto;
}

/* Danh sách cửa hàng */
.portal-sub .th-ds-ch {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
}

.portal-sub .th-ch {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 0 12px;
    overflow: hidden;
    color: var(--h-cream);
    text-decoration: none;
    background: linear-gradient(180deg, #2a1c15, var(--h-ink));
    border: 1px solid var(--h-wood-line);
    border-radius: 3px;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.portal-sub .th-ch:hover {
    color: var(--h-cream);
    text-decoration: none;
    border-color: var(--h-gold);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    transform: translateY(-2px);
}

.portal-sub .th-ch > span {
    padding: 0 14px;
}

.portal-sub .th-ch-bien {
    display: block;
    padding: 10px 14px !important;
    font-family: var(--h-serif);
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--h-gold-hi);
    background: linear-gradient(180deg, #5a1810, #2b0d08);
    border-bottom: 1px solid var(--h-gold);
    overflow-wrap: anywhere;
}

.portal-sub .th-ch-bien i {
    margin-right: 6px;
    font-size: 14px;
}

.portal-sub .th-ch-chu {
    font-size: 13px;
}

.portal-sub .th-ch-chu span {
    font-size: 11.5px;
    color: #9c8a6c;
}

.portal-sub .th-ch-chu b {
    color: #e0c99a;
}

.portal-sub .th-ch-mota {
    font-size: 12.5px;
    font-style: italic;
    color: #bfae8c;
    overflow-wrap: anywhere;
}

.portal-sub .th-ch-hang {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    min-height: 30px;
    align-items: center;
}

.portal-sub .th-ch-hang em {
    font-size: 12px;
    color: #8a7a5e;
}

.portal-sub .th-ch-chan {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 8px !important;
    font-size: 12.5px;
    color: #bfae8c;
    border-top: 1px solid rgba(201, 154, 70, 0.18);
}

.portal-sub .th-ch-vao {
    font-weight: 700;
    color: var(--h-gold-hi);
}

/* Biển hiệu khi vào trong một cửa hàng */
.portal-sub .th-ch-dau {
    position: relative;
    margin-bottom: 14px;
    padding: 14px 18px 14px;
    text-align: center;
    color: var(--h-cream);
    background: linear-gradient(180deg, #3d120c, #1d0907);
    border: 1px solid var(--h-gold);
    border-radius: 3px;
}

.portal-sub .th-ch-ve {
    position: absolute;
    left: 12px;
    top: 10px;
    font-size: 12.5px;
    color: var(--h-gold-hi);
}

.portal-sub .th-ch-dau-ten {
    font-family: var(--h-serif);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--h-gold-hi);
}

.portal-sub .th-ch-dau-chu {
    font-size: 13px;
    color: #bfae8c;
}

.portal-sub .th-ch-dau-chu b {
    color: #e0c99a;
}

.portal-sub .th-ch-dau-mota {
    margin-top: 4px;
    font-size: 13px;
    font-style: italic;
    color: #e0c99a;
}

.portal-sub .th-trong--giay {
    color: var(--h-paper-muted);
}

.portal-sub .th-trong--giay a,
.portal-sub .sgd-vang {
    color: var(--h-gold-hi);
    font-weight: 700;
}

.portal-sub .th-trong--giay a {
    color: var(--h-red);
}

.portal-sub .th-tieu-de {
    margin: 18px 0 8px;
    font-family: var(--h-serif);
    font-size: 17px;
    font-weight: 800;
    color: var(--h-maroon);
}

@media (max-width: 767.98px) {
    .portal-sub .th-ch-ve {
        position: static;
        display: inline-block;
        margin-bottom: 6px;
    }

    .portal-sub .th-ch-dau-ten {
        font-size: 20px;
    }
}
