body {
    font-family: "Sarabun", "Leelawadee UI", "Segoe UI", Tahoma, sans-serif;
    background: #fdfbf4;
}

/* ---------- เมนูฝั่งซ้าย ---------- */
.sidebar {
    width: 235px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #eedfae 0%, #ddc27d 100%);
    color: #6b4a0d;
    position: sticky;
    top: 0;
    height: 100vh;
}

/* ---------- mobile/tablet (< 992px): top bar + เมนูสไลด์จากซ้าย ---------- */
.topbar { display: none; }

@media (max-width: 991.98px) {
    .topbar {
        display: flex;
        align-items: center;
        gap: .75rem;
        background: linear-gradient(180deg, #eedfae 0%, #ddc27d 100%);
        color: #6b4a0d;
        padding: .55rem 1rem;
        position: sticky;
        top: 0;
        z-index: 1040;
    }

    .topbar .menu-btn {
        background: none;
        border: 1px solid rgba(107,74,13,.45);
        color: #6b4a0d;
        border-radius: .4rem;
        font-size: 1.25rem;
        line-height: 1;
        padding: .25rem .6rem;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform .25s ease;
    }

    .sidebar.open {
        transform: none;
        box-shadow: 0 0 32px rgba(0,0,0,.55);
    }

    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.5);
        z-index: 1045;
    }

    .sidebar-backdrop.show { display: block; }
}

.sidebar-brand {
    font-size: 1.05rem;
    font-weight: 700;
    padding: 1.1rem 1rem;
    border-bottom: 1px solid rgba(107,74,13,.18);
}

.side-link {
    display: block;
    color: rgba(107,74,13,.85);
    text-decoration: none;
    padding: .8rem 1rem;
    border-left: 4px solid transparent;
}

.side-link:hover {
    color: #5c3e08;
    background: rgba(255,255,255,.45);
}

.side-link.active {
    color: #5c3e08;
    font-weight: 700;
    background: rgba(255,255,255,.6);
    border-left-color: #b57103;
}

.auto-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #7fe08c;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .3; }
}

.day-header {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin: 1.1rem 0 .6rem;
    padding-bottom: .35rem;
    border-bottom: 2px solid #eddfae;
    color: #814f27;
    font-weight: 700;
    font-size: 1.05rem;
}

.day-header .day-count {
    font-size: .8rem;
}

.day-group:first-child .day-header {
    margin-top: 0;
}

.sign-card .card-img-top {
    background: #fff;
    object-fit: contain;
    height: 160px;
    padding: .5rem;
}

/* การ์ดข้อความมาตรฐาน (is_default — ไม่มีรูป แสดงคำ lock แทน) */
.default-bless {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4eec9;
    color: #814f27;
    font-weight: 700;
    font-size: 1.3rem;
}

.sign-card.new-item {
    animation: flashIn 1.2s ease-out;
}

@keyframes flashIn {
    0% { box-shadow: 0 0 0 4px #d4af5f; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

.status-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: .4rem;
}

.status-dot.online { background: #198754; }
.status-dot.offline { background: #dc3545; }

.stat-tile {
    border-radius: .75rem;
    padding: 1.25rem 1.5rem;
    color: #fff;
}

/* คิวแสดงผล 2 แถว — เลื่อนแนวนอน */
.queue-row {
    display: flex;
    gap: .5rem;
    overflow-x: auto;
    padding-bottom: .4rem;
    min-height: 96px;
    align-items: stretch;
}

.queue-item {
    flex: 0 0 auto;
    width: 118px;
    border: 1px solid #ddd;
    border-radius: .5rem;
    background: #fff;
    text-align: center;
    padding: 4px;
    position: relative;
}

.queue-item img {
    width: 100%;
    height: 52px;
    object-fit: contain;
}

.queue-item .q-name {
    font-size: .7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-item .q-views {
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: .65rem;
    background: #814f27;
    color: #fff;
    border-radius: 8px;
    padding: 0 5px;
}

/* ปุ่ม ✕ ไม่อนุมัติ ในการ์ดคิว/กำลังแสดง */
.queue-item .q-del {
    position: absolute;
    top: 2px;
    left: 4px;
    z-index: 5;
    width: 18px;
    height: 18px;
    line-height: 14px;
    padding: 0;
    font-size: .7rem;
    border: none;
    border-radius: 50%;
    background: #c62828;
    color: #fff;
    cursor: pointer;
}

.queue-item .q-del:hover { background: #8e1b1b; }

/* ตารางสถิติหน้าแดชบอร์ด */
.stat-table thead th {
    color: #814f27;
    border-bottom: 2px solid #eddfae;
}

.stat-table tfoot td {
    border-top: 2px solid #eddfae;
    background: #faf5e3;
}

/* ธีมทองอ่อน: ตัวหนังสือรองใน sidebar */
.sidebar .text-white-50 { color: rgba(107,74,13,.6) !important; }
