:root {
    --red: #7A0C14;
    --gold: #C9A227;
    --light-gold: #E8D8A9;
    --gray: #3A3A3A;
    --bg: #F8F9FA;
    --text: #2C2C2C;
    --dark: #1E1E1E;
    --dark2: #2A2A2A;
    --adminText: #EAEAEA
}

body {
    font-family: Tahoma, Arial, sans-serif;
    background: var(--bg);
    color: var(--text)
}

.notification-dropdown {
    min-width: 320px;
    max-width: 360px;
    max-height: 420px;
    overflow-y: auto;
}

.notification-item.is-unread {
    background: #fff8e1;
}

.notification-item + .notification-item {
    border-top: 1px solid rgba(0, 0, 0, .08);
}

.navbar-luxury {
    background: var(--red)
}

.frontend-marquee {
    width: 100%;
    height: 38px;
    margin: 0;
    border: 0;
    border-bottom: 1px solid rgba(0, 0, 0, .08);
    background: #fff;
    overflow: hidden;
    display: flex;
    align-items: center;
    position: relative;
}

.frontend-marquee-track {
    position: absolute;
    left: 0;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    color: var(--red);
    will-change: transform;
}

.navbar-luxury .navbar-brand,
.navbar-luxury .nav-link {
    color: #fff
}

.navbar-luxury .nav-link:hover {
    color: var(--gold)
}

.site-footer {
    font-size: 11px;
    background: #fff;
    border-top: 1px solid #eee;
    color: #666;
    padding: 24px 0;
    text-align: center;
    line-height: 1.8
}

.btn-primary,
.btn-red {
    background: var(--red);
    border-color: var(--red);
    color: #fff
}

.btn-primary:hover,
.btn-red:hover {
    background: #5e080f;
    border-color: #5e080f;
    color: #fff
}

.btn-green {
    background: #098530;
    border-color: #13c64c;
    color: #fff
}

.btn-green:hover {
    background: #02a736;
    border-color: #06be40;
    color: #fff
}

.page-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .82);
    backdrop-filter: blur(2px);
}

.page-loading-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: 8px;
    background: var(--red);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 16px 40px rgba(0, 0, 0, .22);
}

.btn-pink {
    background: #d63384;
    border-color: #d63384;
    color: #fff
}

.btn-pink:hover {
    background: #b02a6f;
    border-color: #b02a6f;
    color: #fff
}

.btn-gold {
    background: var(--gold);
    border-color: var(--gold);
    color: #1d1d1d;
    font-weight: 300
}

.btn-blue {
    background: linear-gradient(135deg, #0d6efd, #3ea6ff);
    border-color: #0d6efd;
    color: #ffffff;
    font-weight: 600;

    box-shadow:
        0 4px 12px rgba(13, 110, 253, .35);

    transition: all .25s ease;
}

.btn-blue:hover {
    background: linear-gradient(135deg, #0b5ed7, #2196f3);
    border-color: #0b5ed7;

    transform: translateY(-1px);

    box-shadow:
        0 6px 16px rgba(13, 110, 253, .45);
}

.profile-tab-photo,
.profile-tab-photo-placeholder {
    width: 200px;
    height: auto;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid #ddd;
    background: #f9f9f9;
    margin-top: 10px;
    margin-bottom: 30px;
}

.profile-tab-photo {
    object-fit: cover;
}

.profile-tab-photo-placeholder {
    color: #777;
    font-size: 0.9rem;
    font-weight: 600;
}

#profile-photo-preview img
{
    width: 340px;
    height: auto;
    border-radius: 12px;
    object-fit: cover;
}

#profile-camera-video {
    width: 500px;
    height: auto;
    border-radius: 12px;
    max-height: 420px;
    object-fit: cover;
}

.camera-capture-wrap {
    width: 100%;
    overflow: hidden;
    border: 1px solid #ddd;
    border-radius: 12px;
    background: #000;
}

#qr-reader {
    width: 100%;
    max-width: 500px;
    margin-bottom: 1rem;
}

#qr-reader .qr-reader__camera {
    width: 100% !important;
}

@media(max-width:767px) {

    .profile-tab-photo,
    .profile-tab-photo-placeholder {
        width: 100%;
        max-width: 240px;
        height: auto;
        aspect-ratio: 3/2;
    }

    #qr-reader {
        max-width: 100%;
    }
}

@media(max-width:991px) {
    .admin-sidebar {
        position: static;
        width: 100%;
        height: auto
    }

    .admin-layout {
        display: block
    }

    .admin-main {
        margin-left: 0;
        width: 100%
    }
}

.btn-gold:hover {
    background: #FC9;
    border-color: #FC9;
    color: #111
}

.btn-group-sm>.btn,
.btn-sm {
    --bs-btn-font-size: 0.50rem;
    margin-bottom: 4px;
}

.lux-card {
    padding-bottom: 20px;
    background: #fff;
    border: 1px solid #eee;
    border-top: 4px solid var(--gold);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .06)
}

.lux-card .nav-link.active {
    background-color: #ececec
}

.lux-card .nav-link:hover {
    background-color: #FF9
}

.hero-section {
    width: 100%;
    padding: 50px 20px;
    text-align: center;
    background: #fff
}

.hero-container {
    max-width: 1200px;
    margin: auto
}

.hero .hero-container {
    max-width: none;
    text-align: center
}

.hero .hero-container .logo-text {
    font-size: 16px;
    letter-spacing: 4px;
    margin-bottom: 12px
}

.hero .hero-container .main-title {
    font-size: 42px
}

.hero .hero-container .sub-title {
    font-size: 16px;
    margin-top: 14px;
    line-height: 1.6
}

.hero .hero-container .sub-title .date {
    font-size: 20px
}

.hero .hero-container .countdown-wrap {
    margin-top: 24px
}

.hero .hero-container #countdown {
    gap: 10px
}

.hero .hero-container .time-box {
    min-width: 70px;
    border-radius: 16px;
    padding: 5px 5px
}

.hero .hero-container .time-box h2 {
    font-size: 30px
}

.hero .hero-container .time-box span {
    font-size: 11px
}

.logo-text {
    font-size: 22px;
    letter-spacing: 6px;
    color: #999;
    margin-bottom: 20px;
    animation: fadeUp 1s ease
}

.main-title {
    font-size: 72px;
    font-weight: 700;
    color: #111;
    line-height: 1.1;
    animation: fadeUp 1.2s ease
}

.main-title span {
    color: #c59d5f
}

.sub-title {
    margin-top: 25px;
    font-size: 24px;
    color: #666;
    line-height: 1.8;
    animation: fadeUp 1.4s ease
}

.sub-title .date {
    display: block;
    margin-top: 10px;
    font-size: 32px;
    font-weight: 700;
    color: #111
}

.countdown-wrap {
    margin-top: 45px;
    animation: fadeUp 1.6s ease
}

#countdown {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap
}

.time-box {
    min-width: 120px;
    background: #fff;
    border: 2px solid #f0f0f0;
    border-radius: 22px;
    padding: 25px 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, .08);
    transition: .3s
}

.time-box:hover {
    transform: translateY(-5px)
}

.time-box h2 {
    font-size: 58px;
    color: #111;
    line-height: 1
}

.time-box span {
    display: block;
    margin-top: 10px;
    color: #888;
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(35px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.hero {
    background: linear-gradient(135deg, #fff, #f5f0df);
    border-bottom: 1px solid #eadcae;
    position: relative;
    overflow: hidden;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center
}

.hero.hero-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: inherit;
    background-size: inherit;
    background-position: inherit;
    background-repeat: inherit;
    filter: blur(14px) brightness(0.75);
    opacity: 0.7;
    z-index: 0;
}

.hero.hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.45);
    z-index: 0;
}

.hero .container {
    position: relative;
    z-index: 1
}

.hero h1 {
    color: var(--red);
    font-weight: 800;

    /* ขอบตัวอักษร */
    -webkit-text-stroke: 0.7px #cccccc;

    /* เงา */
    text-shadow:
        2px 2px 6px rgba(0, 0, 0, 0.35),
        0 0 10px rgba(255, 255, 255, 0.4);
}

.frontend-rich-section {
    background: #fff;
    display: block;
}

.frontend-rich-content {
    display: block;
    visibility: visible;
    color: var(--text);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.frontend-rich-content img,
.frontend-lead img {
    max-width: 100%;
    height: auto;
}

.frontend-rich-content table,
.frontend-lead table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    max-width: 100%;
}

.frontend-rich-content td,
.frontend-rich-content th,
.frontend-lead td,
.frontend-lead th {
    border: 1px solid rgba(0, 0, 0, .2);
    padding: 8px;
}

.frontend-rich-content a,
.frontend-lead a {
    color: var(--red);
    text-decoration: underline;
}

@media(max-width:768px) {
    .frontend-rich-section {
        display: block !important;
        padding-top: 16px !important;
        padding-bottom: 16px !important;
    }

    .frontend-rich-section .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .frontend-rich-content {
        display: block !important;
        visibility: visible !important;
        min-height: 1px;
        padding: 16px !important;
        overflow-x: auto;
        word-break: break-word;
    }

    .frontend-rich-content img {
        max-width: 100% !important;
        height: auto !important;
    }

    .frontend-rich-content table {
        min-width: 0;
        max-width: 100% !important;
    }
}

.form-control,
.form-select {
    border-radius: 8px
}

.qr-svg {
    margin-top: 20px;
    margin-bottom: 10px;
    width: 232px;
    height: 232px;
    border: 10px solid #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .14)
}

.admin-body {
    background: var(--dark);
    color: var(--adminText)
}

.admin-layout {
    display: flex;
    min-height: 100vh;
    background: var(--dark)
}

.admin-sidebar {
    width: auto;
    background: #151515;
    padding: 22px 16px;
    position: fixed;
    inset: 0 auto 0 0;
    overflow: auto
}

.admin-sidebar .brand {
    color: var(--gold);
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 20px
}

.admin-sidebar a {
    display: block;
    color: #d8d8d8;
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 4px
}

.admin-sidebar a:hover,
.admin-sidebar a.active {
    background: var(--dark2);
    color: var(--gold)
}

.admin-main {
    margin-left: 155px;
    width: calc(100% - 155px);
    transition: margin-left .3s ease, width .3s ease
}

/* ปุ่ม emoji ย่อ/ขยาย sidebar */
.sidebar-collapse-btn {
    position: fixed;
    top: 29px;
    left: 120px;
    z-index: 1060;
    background: rgba(40, 40, 40, .85);
    color: var(--gold);
    border: 1px solid #444;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    font-size: 14px;
    /*line-height:30px;*/
    text-align: center;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
    transition: left .3s ease, background .2s ease, transform .2s ease;
}

.sidebar-collapse-btn:hover {
    background: var(--gold);
    color: #111;
    transform: scale(1.15)
}

/* sidebar collapsed */
.admin-sidebar.collapsed {
    transform: translateX(-100%);
    visibility: hidden
}

.admin-sidebar.collapsed~.sidebar-collapse-btn {
    left: 12px
}

.admin-sidebar.collapsed~section.admin-main {
    margin-left: 0;
    width: 100%
}

.admin-sidebar {
    transition: transform .3s ease, visibility .3s ease
}

.admin-topbar {
    background: var(--dark2);
    border-bottom: 1px solid #333;
    padding: 6px 1px 1px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px
}

.admin-sidebar-toggler {
    display: none;
    border-color: rgba(255, 255, 255, .55);
    color: #fff;
    /*padding:.45rem .75rem;*/
    border-radius: .5rem;
    background: transparent
}

.admin-topbar h1 {
    font-size: 20px;
    margin: 0;
    color: #fff
}

.admin-topbar span {
    color: #b0b0b0
}

.admin-card {
    background: var(--dark2);
    border: 1px solid #383838;
    border-top: 3px solid var(--gold);
    border-radius: 8px;
    color: var(--adminText);
    padding: 8px 20px 8px 20px
}

.admin-card-toggle-card {
    position: relative;
}

.admin-card-toggle-card > h2 {
    padding-right: 36px;
}

.admin-card-toggle-btn {
    align-items: center;
    background: #2b2b2b;
    border: 1px solid #4a4a4a;
    border-radius: 6px;
    color: #fff;
    display: inline-flex;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    height: 26px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    position: absolute;
    right: 10px;
    top: 8px;
    width: 28px;
}

.admin-card-toggle-btn:hover,
.admin-card-toggle-btn:focus {
    background: #383838;
    border-color: var(--gold);
    color: #fff;
}

.admin-card-toggle-target.is-hidden {
    display: none !important;
}

.btn-orange {
    background: #f28c28;
    border-color: #f28c28;
    color: #fff;
}

.btn-orange:hover,
.btn-orange:focus {
    background: #d97706;
    border-color: #d97706;
    color: #fff;
}

.admin-card .metric {
    font-size: 28px;
    font-weight: 800;
    color: var(--gold)
}

.transfer-account-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    color: #222;
    overflow: hidden;
}

.transfer-account-img {
    background: #f5f5f5;
    display: block;
    height: auto;
    width: 100%;
}

.transfer-account-note {
    font-size: 13px;
    padding: 12px;
    white-space: normal;
}

.admin-body .form-control,
.admin-body .form-select {
    background: #675252;
    border-color: #444;
    color: #fff
}

.admin-body .table {
    --bs-table-bg: var(--dark2);
    --bs-table-color: #eaeaea;
    --bs-table-border-color: #444
}

.admin-body .dataTables_wrapper,
.admin-body .dataTables_info,
.admin-body .dataTables_length label,
.admin-body .dataTables_filter label {
    color: #eaeaea !important
}

.admin-body .page-link {
    background: #242424;
    border-color: #444;
    color: #eaeaea
}

.admin-body .page-item.active .page-link {
    background: var(--gold);
    border-color: var(--gold);
    color: #111
}

.admin-body .btn-add-white {
    background: #fff;
    border-color: #fff;
    color: #111;
    font-weight: 600
}

.admin-body .btn-add-white:hover,
.admin-body .btn-add-white:focus {
    background: #f1f1f1;
    border-color: #f1f1f1;
    color: #000
}

.admin-body .btn-group-vertical>.btn,
.admin-body .btn-group>.btn {
    position: relative;
    /* flex: 1 1 auto; */
    padding: 1px 5px 1px 5px;
    margin-left: 5px;
}

.file-name {
    max-width: 20ch;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom
}

.map-detail {
    font-size: 13px;
    background: #f8f9fa;
    border-radius: 8px;
    white-space: normal;
    line-height: 1.8;
    color: #333
}

.timeline {
    border-left: 3px solid var(--gold);
    padding-left: 18px
}

.timeline-item {
    position: relative;
    margin-bottom: 16px;
    padding-left: 10px;
}

.timeline-item:before {
    content: "";
    position: absolute;
    left: -27px;
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--red);
    border: 2px solid var(--gold)
}

.thai-calendar {
    position: absolute;
    z-index: 1055;
    background: #fff;
    color: #2c2c2c;
    border: 1px solid #ddd;
    border-top: 3px solid var(--gold);
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
    padding: 12px;
    min-width: 300px
}

.thai-calendar .calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px
}

.thai-calendar button {
    border: 0;
    background: #f3f3f3;
    border-radius: 6px;
    padding: 7px 0;
    color: #2c2c2c
}

.thai-calendar button:hover,
.thai-calendar button.active {
    background: var(--red);
    color: #fff
}

.thai-calendar .dow {
    font-size: 12px;
    text-align: center;
    color: #777;
    padding: 4px 0
}

.admin-body .thai-calendar {
    background: #242424;
    color: #eaeaea;
    border-color: #444
}

.admin-body .thai-calendar button {
    background: #333;
    color: #eaeaea
}

.admin-body .thai-calendar button:hover,
.admin-body .thai-calendar button.active {
    background: var(--gold);
    color: #111
}

.admin-body .thai-calendar .dow {
    color: #b0b0b0
}

@media(max-width:991px) {
    .admin-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 260px;
        transform: translateX(-100%);
        visibility: hidden;
        z-index: 1050;
        transition: transform .25s ease, visibility .25s ease
    }

    .admin-sidebar.open {
        transform: translateX(0);
        visibility: visible
    }

    .admin-layout {
        display: block
    }

    .admin-main {
        margin-left: 0;
        width: 100%
    }

    .admin-sidebar-toggler {
        display: inline-flex
    }

    .admin-main.overlay-open::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .45);
        z-index: 1040
    }

    .sidebar-collapse-btn {
        display: none
    }
}

@media(max-width:768px) {

    .py-41 {
        padding-top: 0px;
        padding-bottom: 0px;
    }

    .py-4 {
        padding-top: 0px;
        padding-bottom: 0px;
    }
    .h4.mb-3{
        font-size: 15px;
    }
    .nav.nav-tabs{
        font-size: 12px;
    }
    .tab-content.pt-4{
        font-size: 14px;
    }

    .main-title {
        font-size: 48px
    }

    .sub-title {
        font-size: 18px
    }

    .sub-title .date {
        font-size: 24px
    }

    .time-box {
        min-width: 50px;
        padding: 18px 10px
    }

    .time-box h2 {
        font-size: 40px
    }
}

@media(max-width:480px) {
    .main-title {
        font-size: 38px
    }

    .sub-title {
        font-size: 16px
    }

    .time-box {
        min-width: 50px;
        border-radius: 16px
    }

    .time-box h2 {
        font-size: 32px
    }

    .time-box span {
        font-size: 11px
    }
}

@media print {

    .navbar,
    .admin-sidebar,
    .admin-topbar,
    .btn,
    .report-print-controls,
    .dataTables_filter,
    .dataTables_length,
    .dataTables_paginate,
    .dt-buttons {
        display: none !important
    }

    .admin-main {
        margin: 0;
        width: 100%
    }

    body,
    .admin-body {
        background: #fff;
        color: #000
    }

    .admin-card,
    .lux-card {
        padding-bottom: 20px;
        box-shadow: none;
        border-color: #ccc;
        color: #000
    }
}

/* ============================================================
   Rich Content — mimic Quill editor output styles
   ใช้กับ div ที่ render HTML จาก Quill editor
   ============================================================ */
.rich-content {
    line-height: 1.8;
    word-break: break-word;
}

.rich-content p {
    margin: 0 0 0.6em;
}

.rich-content p:last-child {
    margin-bottom: 0;
}

/* Lists — Bootstrap reset ทำให้หาย ต้อง restore */
.rich-content ul,
.rich-content ol {
    padding-left: 1.8em;
    margin: 0.4em 0 0.8em;
}

.rich-content ul {
    list-style-type: disc;
}

.rich-content ol {
    list-style-type: decimal;
}

.rich-content li {
    margin-bottom: 0.25em;
}

/* Quill alignment classes */
.rich-content .ql-align-center {
    text-align: center;
}

.rich-content .ql-align-right {
    text-align: right;
}

.rich-content .ql-align-justify {
    text-align: justify;
}

/* Headings */
.rich-content h1 { font-size: 2em;   font-weight: 700; margin: 0.67em 0; }
.rich-content h2 { font-size: 1.5em; font-weight: 700; margin: 0.75em 0; }
.rich-content h3 { font-size: 1.2em; font-weight: 700; margin: 0.83em 0; }
.rich-content h4,
.rich-content h5,
.rich-content h6 { font-weight: 700; margin: 1em 0; }

/* Blockquote */
.rich-content blockquote {
    border-left: 4px solid #ddd;
    padding-left: 1em;
    margin: 0.8em 0;
    color: #666;
    font-style: italic;
}

/* Inline */
.rich-content a {
    color: var(--red, #c00);
    text-decoration: underline;
}

.rich-content strong, .rich-content b { font-weight: 700; }
.rich-content em,     .rich-content i { font-style: italic; }
.rich-content u { text-decoration: underline; }
.rich-content s { text-decoration: line-through; }

/* Code */
.rich-content pre,
.rich-content code {
    background: #f4f4f4;
    border-radius: 4px;
    font-size: 0.9em;
}

.rich-content pre {
    padding: 0.75em 1em;
    overflow-x: auto;
    margin: 0.6em 0;
}

.rich-content code {
    padding: 0.1em 0.3em;
}

/* Table */
.rich-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.8em 0;
}

.rich-content td,
.rich-content th {
    border: 1px solid #ccc;
    padding: 6px 10px;
}

.rich-content img {
    max-width: 100%;
    height: auto;
}

