:root {
    --sidebar-bg: #1e1e2d;
    --sidebar-text: #a6a6c0;
    --primary: #00C853;
    --bg: #f5f8fa;
}

body { font-family: 'Kanit', sans-serif; margin: 0; background: var(--bg); display: flex; height: 100vh; overflow: hidden; }

/* Login */
.login-container { width: 100%; height: 100vh; display: flex; justify-content: center; align-items: center; background: #222; }
.login-box { background: white; padding: 40px; border-radius: 12px; width: 300px; text-align: center; }
.login-box input { width: 100%; padding: 10px; margin: 10px 0; border: 1px solid #ddd; border-radius: 6px; box-sizing: border-box; }
.login-box button { width: 100%; padding: 10px; background: var(--primary); color: white; border: none; border-radius: 6px; cursor: pointer; font-size: 1rem; }

/* Dashboard Layout */
#dashboard-section { display: flex; width: 100%; height: 100%; }
.sidebar { width: 250px; background: var(--sidebar-bg); color: white; display: flex; flex-direction: column; padding: 20px; flex-shrink: 0; }
.logo { font-size: 1.5rem; font-weight: bold; margin-bottom: 40px; color: white; text-align: center; }
.menu { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; height: 100%; }
.menu li { padding: 15px; margin-bottom: 5px; cursor: pointer; border-radius: 8px; color: var(--sidebar-text); transition: 0.2s; display: flex; align-items: center; gap: 10px; }
.menu li:hover, .menu li.active { background: #2b2b40; color: white; }
.badge { background: #ff4d4f; color: white; padding: 2px 8px; border-radius: 10px; font-size: 0.7rem; margin-left: auto; }
.badge.hidden { display: none; }

.main-content { flex: 1; padding: 30px; overflow-y: auto; }
.page-section { display: none; }
.page-section.active { display: block; animation: fadeIn 0.3s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Stats Cards */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 30px; }
.stat-card { background: white; padding: 20px; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.stat-card.warning { border-left: 5px solid #ff9800; }
.stat-title { color: #888; font-size: 0.9rem; }
.stat-value { font-size: 1.8rem; font-weight: bold; margin-top: 5px; color: #333; }

/* Table */
.table-responsive { background: white; border-radius: 12px; padding: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 800px; }
.data-table th, .data-table td { text-align: left; padding: 12px; border-bottom: 1px solid #eee; }
.data-table th { color: #888; font-weight: 500; font-size: 0.9rem; }
.status-badge { padding: 4px 10px; border-radius: 20px; font-size: 0.8rem; }
.status-pending { background: #fff7e6; color: #ffa940; }
.status-confirmed { background: #f6ffed; color: #52c41a; }
.status-cancelled { background: #fff1f0; color: #ff4d4f; }
.btn-action { padding: 5px 10px; border: none; border-radius: 4px; cursor: pointer; margin-right: 5px; font-size: 0.8rem; }
.btn-approve { background: #52c41a; color: white; }
.btn-reject { background: #ff4d4f; color: white; }

/* --- Calendar Styles Update (Final Version) --- */
.admin-calendar { 
    display: grid; 
    grid-template-columns: repeat(7, 1fr); 
    gap: 10px; 
    margin-top: 20px; 
}

.cal-day { 
    min-height: 100px; 
    padding: 10px; 
    border-radius: 12px;
    border: 1px solid #eee; 
    position: relative; 
    cursor: pointer; 
    transition: 0.2s; 
    background: white; 
    display: flex; 
    flex-direction: column; 
    justify-content: space-between;
}
.home-tag {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.home-1 { background: #e3f2fd; color: #1565c0; border: 1px solid #bbdefb; }
.home-2 { background: #f3e5f5; color: #7b1fa2; border: 1px solid #e1bee7; }

/* --- Calendar House Switcher (ปุ่มสลับปฏิทิน) --- */
.cal-home-tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    justify-content: center;
    flex-wrap: wrap;
}
.cal-home-btn {
    padding: 12px 24px;
    border-radius: 50px;
    border: 2px solid #ddd;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.95rem;
    color: #666;
}
.cal-home-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.cal-home-btn.active.home-1 {
    background: linear-gradient(135deg, #1565c0, #1976d2);
    color: white;
    border-color: #1565c0;
    box-shadow: 0 4px 15px rgba(21,101,192,0.3);
}
.cal-home-btn.active.home-2 {
    background: linear-gradient(135deg, #7b1fa2, #9c27b0);
    color: white;
    border-color: #7b1fa2;
    box-shadow: 0 4px 15px rgba(123,31,162,0.3);
}
.cal-day:hover { transform: translateY(-3px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

.cal-date { font-weight: bold; font-size: 1.2rem; margin-bottom: 5px; }
.cal-info { font-size: 0.75rem; padding: 4px 8px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 5px;}

/* 🟢 ว่าง */
.cal-day.available { 
    background-color: #f0fff4; 
    border: 1px solid #00C853; 
    color: #00C853;
}
.cal-day.available .cal-info { background: #00C853; color: white; }

/* 🔴 จองแล้ว */
.cal-day.booked { 
    background-color: #fff1f0; 
    border: 1px solid #ff4d4f; 
    color: #ff4d4f;
}
.cal-day.booked .cal-info { background: #ff4d4f; color: white; }

/* 🟠 รอยืนยัน */
.cal-day.pending { 
    background-color: #fff7e6; 
    border: 1px solid #ffa940; 
    color: #d46b08;
}
.cal-day.pending .cal-info { background: #ffa940; color: white; }

/* ⚫ ปิดห้อง */
.cal-day.blocked { 
    background-color: #333; 
    border: 1px solid #000; 
    color: #ccc;
}
.cal-day.blocked .cal-info { background: #555; color: white; }

/* ⚪ วันที่ผ่านมาแล้ว */
.cal-day.past { 
    background-color: #f5f5f5; 
    border-color: #e0e0e0; 
    color: #bbb;
    cursor: not-allowed;
    pointer-events: none;
}
.cal-day.past .cal-info { display: none; }

/* Reviews */
.review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.review-item { background: white; padding: 15px; border-radius: 12px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.btn-del-review { float: right; color: #ff4d4f; cursor: pointer; }


/* ✨ Search Bar Styling */
.search-wrapper {
    margin-bottom: 20px;
    display: flex;
    justify-content: flex-start;
}

.search-container {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 50px;
    padding: 5px 5px 5px 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
    width: 100%;
    max-width: 400px;
    transition: all 0.3s ease;
}

.search-container:focus-within {
    box-shadow: 0 4px 20px rgba(0, 200, 83, 0.15);
    border-color: #00C853;
}

.search-container input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 1rem;
    color: #555;
    background: transparent;
    padding: 0;
    margin: 0;
}

.btn-search {
    background: linear-gradient(135deg, #00C853, #009624);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-left: 10px;
}

.btn-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 200, 83, 0.3);
}

.btn-search:active {
    transform: translateY(0);
}

/* เพิ่มสี Badge สำหรับสถานะใหม่ payment_review */
.status-payment_review { background: #e6f7ff; color: #1890ff; border: 1px solid #91d5ff; }

/* --- เพิ่มต่อท้ายไฟล์ admin.css --- */

/* วันที่มีการเปลี่ยนกะ (คนหนึ่งออก คนหนึ่งเข้า) */
.cal-day.swap {
    background: linear-gradient(135deg, #fff1f0 50%, #f6ffed 50%); /* ครึ่งแดง ครึ่งเขียว */
    border: 2px solid #1890ff; /* ขอบน้ำเงินให้รู้ว่าพิเศษ */
}

.cal-day.swap .cal-info {
    background: #1890ff; 
    color: white; 
    font-size: 0.7rem; 
    padding: 2px 5px;
}

/* กล่องแสดงข้อมูลผู้เข้าพักคนต่อไปใน Popup */
.next-guest-box {
    margin-top: 20px;
    background: #f0f5ff;
    border: 1px dashed #1890ff;
    border-radius: 8px;
    padding: 10px 15px;
    position: relative;
}

.next-guest-title {
    font-size: 0.85rem;
    font-weight: bold;
    color: #1890ff;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}
/* --- CYBERPUNK SETTINGS THEME --- */
.cyber-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 80vh;
    perspective: 1000px;
}

.cyber-card {
    background: rgba(20, 20, 30, 0.9);
    padding: 40px;
    border-radius: 15px;
    border: 1px solid rgba(0, 200, 83, 0.3);
    box-shadow: 0 0 20px rgba(0, 200, 83, 0.1), inset 0 0 50px rgba(0,0,0,0.8);
    width: 400px;
    text-align: center;
    backdrop-filter: blur(10px);
    transform-style: preserve-3d;
    animation: cardFloat 3s ease-in-out infinite alternate;
}

@keyframes cardFloat {
    0% { transform: translateY(0) rotateX(0deg); }
    100% { transform: translateY(-10px) rotateX(2deg); }
}

.card-header {
    font-size: 1.5rem;
    color: #fff;
    font-weight: bold;
    margin-bottom: 30px;
    letter-spacing: 2px;
    text-shadow: 0 0 10px #00C853;
}

/* Inputs เท่ๆ */
.input-group-cyber {
    position: relative;
    margin-bottom: 30px;
    text-align: left;
}

.input-group-cyber input {
    width: 100%;
    padding: 10px 0;
    font-size: 1.2rem;
    color: #fff;
    background: transparent;
    border: none;
    border-bottom: 2px solid #333;
    outline: none;
    transition: 0.3s;
    font-family: 'Courier New', monospace; /* ฟอนต์สไตล์โค้ด */
}

.input-group-cyber label {
    position: absolute;
    top: 10px;
    left: 0;
    color: #666;
    pointer-events: none;
    transition: 0.3s;
    font-size: 1rem;
}

/* Animation ตอนคลิก Input */
.input-group-cyber input:focus ~ label,
.input-group-cyber input:valid ~ label {
    top: -20px;
    font-size: 0.8rem;
    color: #00C853;
    text-shadow: 0 0 5px #00C853;
}

.input-group-cyber .cyber-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #00C853;
    box-shadow: 0 0 10px #00C853;
    transition: 0.4s;
}

.input-group-cyber input:focus ~ .cyber-line,
.input-group-cyber input:valid ~ .cyber-line {
    width: 100%;
}

/* HUD แสดงสถานะ */
.price-hud {
    background: #000;
    border: 1px solid #333;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
    transition: 0.3s;
}

.hud-icon {
    font-size: 1.5rem;
    color: #555;
}

.hud-info {
    text-align: left;
    flex-grow: 1;
}

.hud-label {
    display: block;
    font-size: 0.7rem;
    color: #555;
    letter-spacing: 1px;
}

/* --- แก้ไข CSS ส่วนสีตัวหนังสือโปรโมชั่นให้รองรับ 2 บ้าน --- */
[id^="promo-status-text"] {
    font-weight: bold;
    font-family: 'Courier New', monospace;
    transition: 0.3s;
}

/* Scan line effect */
.hud-scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(0, 200, 83, 0.1), transparent);
    transform: translateY(-100%);
    animation: scan 2s linear infinite;
}

@keyframes scan {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

/* สถานะ Active (จะใช้ JS สั่งเปลี่ยนสี) */
.price-hud.active-promo {
    border-color: #FFD700; /* สีทอง */
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3); /* แสงฟุ้งสีทอง */
}
.price-hud.active-promo .hud-icon { 
    color: #FFD700; /* ไอคอนสีทอง */
    animation: blink 1s infinite; 
}
.price-hud.active-promo [id^="promo-status-text"] { 
    color: #FFD700; /* ตัวหนังสือสีทอง */
}

/* 🟢 สถานะ Active: NORMAL (สีเขียวแบบเดิม) */
.price-hud.active-normal {
    border-color: #00C853;
    box-shadow: 0 0 15px rgba(0, 200, 83, 0.3);
}
.price-hud.active-normal .hud-icon { color: #00C853; }
.price-hud.active-normal [id^="promo-status-text"] { color: #00C853; }
@keyframes blink { 50% { opacity: 0.5; } }

/* ปุ่ม Save สุดเท่ */
.btn-cyber-save {
    background: transparent;
    border: 2px solid #00C853;
    color: #00C853;
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: 0.3s;
    width: 100%;
    letter-spacing: 2px;
}

.btn-cyber-save:hover {
    background: #00C853;
    color: #000;
    box-shadow: 0 0 20px #00C853;
}
/* ===== MODERN DASHBOARD STYLES ===== */

/* Filter Section */
.filter-section {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-btn {
    padding: 12px 24px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-family: 'Kanit', sans-serif;
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-color: #00C853;
}

.filter-btn.active {
    background: linear-gradient(135deg, #00C853, #00E676);
    color: white;
    border-color: #00C853;
    box-shadow: 0 4px 20px rgba(0, 200, 83, 0.3);
}

.filter-btn i {
    font-size: 1rem;
}

/* Hero Stats Cards with Glassmorphism */
.hero-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.hero-card {
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.8);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    animation: cardFadeIn 0.6s ease-out;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-card:nth-child(1) { animation-delay: 0.1s; }
.hero-card:nth-child(2) { animation-delay: 0.2s; }
.hero-card:nth-child(3) { animation-delay: 0.3s; }
.hero-card:nth-child(4) { animation-delay: 0.4s; }

.hero-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Revenue Card - Purple to Pink Gradient */
.revenue-card {
    background: linear-gradient(135deg, #667eea 0%, #f093fb 100%);
    color: white;
}

/* Bookings Card - Green to Cyan Gradient */
.bookings-card {
    background: linear-gradient(135deg, #00C853 0%, #00E5FF 100%);
    color: white;
}

/* Pending Card - Orange to Red Gradient */
.pending-card {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
}

/* Rate Card - Blue to Purple Gradient */
.rate-card {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
    color: white;
}

.card-icon {
    font-size: 3rem;
    opacity: 0.3;
    position: absolute;
    top: 20px;
    right: 20px;
}

.card-content {
    position: relative;
    z-index: 2;
}

.card-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 10px;
    font-weight: 300;
    letter-spacing: 0.5px;
}

.card-value {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.card-trend {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
    opacity: 0.9;
}

.card-glow {
    position: absolute;
    bottom: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s;
}

.hero-card:hover .card-glow {
    opacity: 1;
}

/* Chart Container */
.chart-container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    margin-bottom: 40px;
    animation: cardFadeIn 0.6s ease-out 0.5s backwards;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.chart-header h3 {
    font-size: 1.3rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.chart-legend {
    display: flex;
    gap: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #666;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.revenue-dot {
    background: linear-gradient(135deg, #667eea, #f093fb);
}

.bookings-dot {
    background: linear-gradient(135deg, #00C853, #00E676);
}

#revenueChart {
    max-height: 350px;
}

/* Weekly Breakdown Section */
.weekly-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    animation: cardFadeIn 0.6s ease-out 0.6s backwards;
}

.weekly-section h3 {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.weekly-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.week-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 20px;
    border-radius: 15px;
    border-left: 4px solid #00C853;
    transition: all 0.3s ease;
}

.week-card:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.week-title {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.week-revenue {
    font-size: 1.8rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.week-bookings {
    font-size: 0.9rem;
    color: #888;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Count Up Animation */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.counting {
    animation: countUp 0.5s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-btn {
        width: 100%;
        justify-content: center;
    }
    
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* --- Modern Table Style by David --- */
.table-responsive {
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05); /* เงานุ่มๆ */
    background: white;
    padding: 20px;
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: separate; /* แยกแถวออกจากกัน */
    border-spacing: 0 12px; /* ระยะห่างระหว่างแถว */
    margin-top: -10px;
}

.data-table thead th {
    background: transparent;
    color: #8898aa;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    padding: 15px 20px;
    border: none;
}

.data-table tbody tr {
    background: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
    border-radius: 12px;
}

.data-table tbody tr:hover {
    transform: translateY(-3px) scale(1.01); /* ลอยขึ้นเล็กน้อย */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    z-index: 10;
    position: relative;
}

.data-table td {
    padding: 20px;
    vertical-align: middle;
    border: none;
    color: #444;
    font-size: 0.95rem;
}

/* จัดการขอบมนให้แถว */
.data-table tbody tr td:first-child { border-radius: 12px 0 0 12px; }
.data-table tbody tr td:last-child { border-radius: 0 12px 12px 0; }

/* Booking ID สวยๆ */
.booking-id-tag {
    background: #e3f2fd;
    color: #1565c0;
    padding: 5px 10px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.85rem;
    text-decoration: none;
    transition: 0.2s;
}
.booking-id-tag:hover { background: #1565c0; color: white; }

/* User Profile ในตาราง */
.user-cell {
    display: flex;
    align-items: center;
    gap: 15px;
}
.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #eee;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.user-info h4 { margin: 0; font-size: 1rem; color: #333; }
.user-info span { font-size: 0.8rem; color: #888; }

/* Status Badges ปรับปรุงใหม่ */
.status-badge {
    padding: 6px 12px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-transform: capitalize;
}
.status-confirmed { background: #e6fffa; color: #00b894; border: 1px solid #b2f5ea; }
.status-payment_review { background: #fff8e1; color: #ffa000; border: 1px solid #ffe082; }
.status-waiting_payment { background: #f3f0ff; color: #845ef7; border: 1px solid #e5dbff; }
.status-cancelled { background: #fff5f5; color: #e03131; border: 1px solid #ffc9c9; }

/* ปุ่ม Action สวยๆ */
.action-buttons {
    display: flex;
    gap: 8px;
}
.btn-icon {
    width: 35px;
    height: 35px;
    border-radius: 8px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
    font-size: 1rem;
}
.btn-approve { background: #e6fffa; color: #00b894; }
.btn-approve:hover { background: #00b894; color: white; }

.btn-reject { background: #fff5f5; color: #e03131; }
.btn-reject:hover { background: #e03131; color: white; }

.btn-slip { background: #e7f5ff; color: #1971c2; width: auto; padding: 0 15px; font-size: 0.85rem; font-weight: 600;}
.btn-slip:hover { background: #1890ff; color: white; }
.btn-slip i { margin-right: 5px; }

/* --- Sidebar Badge Notification --- */
.badge {
    background-color: #ff4d4f; /* สีแดงแจ้งเตือน */
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: auto; /* ดันไปชิดขวาสุดของเมนู */
    display: inline-block;
    min-width: 18px;
    text-align: center;
    transition: 0.3s;
}

.badge.hidden {
    display: none; /* ซ่อนถ้าไม่มีงาน */
}

/* --- ปรับปุ่ม Action ให้มีข้อความ --- */
.btn-action-text {
    display: inline-flex;
    align-items: center;
    gap: 6px; /* ระยะห่างระหว่างไอคอนกับตัวหนังสือ */
    padding: 6px 12px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: 0.2s;
    text-decoration: none;
}

.btn-approve {
    background: #e6fffa; 
    color: #00b894; 
    border: 1px solid transparent;
}
.btn-approve:hover {
    background: #00b894; 
    color: white;
    box-shadow: 0 4px 10px rgba(0, 184, 148, 0.3);
}

.btn-reject {
    background: #fff5f5; 
    color: #e03131; 
    border: 1px solid transparent;
}
.btn-reject:hover {
    background: #e03131; 
    color: white;
    box-shadow: 0 4px 10px rgba(224, 49, 49, 0.3);
}

/* ปรับให้เมนู Sidebar รองรับ badge ชิดขวา */
.menu li {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* ปกติชิดซ้าย */
    padding-right: 15px; /* เผื่อที่ให้ badge */
}

/* ===== MODERN CALENDAR CONTROLS ===== */

.modern-calendar-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

/* Navigation Buttons */
.nav-btn {
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.nav-btn:active {
    transform: scale(0.95);
}

/* Month Selector Container */
.month-selector-container {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.current-month-display {
    width: 100%;
    padding: 12px 20px;
    background: white;
    border: none;
    border-radius: 15px;
    font-size: 18px;
    font-weight: 600;
    color: #667eea;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.current-month-display:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.dropdown-icon {
    transition: transform 0.3s ease;
    font-size: 14px;
}

.current-month-display:hover .dropdown-icon {
    transform: rotate(180deg);
}

/* Month Picker Dropdown */
.month-picker-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
    padding: 20px;
    z-index: 1000;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Month Grid */
.month-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.month-btn {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    color: #333;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.month-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.month-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Year Selector */
.year-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 15px 0 5px 0;
    border-top: 2px solid #f0f0f0;
}

.year-selector button {
    width: 35px;
    height: 35px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.year-selector button:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.year-selector span {
    font-size: 20px;
    font-weight: 700;
    color: #667eea;
    min-width: 80px;
    text-align: center;
}

/* Today Button */
.today-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.95);
    color: #667eea;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.today-btn:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.today-btn i {
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .modern-calendar-controls {
        flex-wrap: wrap;
        gap: 10px;
        padding: 15px;
    }
    
    .month-selector-container {
        order: -1;
        flex-basis: 100%;
        max-width: 100%;
    }
    
    .today-btn {
        margin-left: auto;
    }
    
    .month-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .modern-calendar-controls {
        padding: 10px;
    }
    
    .nav-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .current-month-display {
        font-size: 16px;
        padding: 10px 15px;
    }
    
    .today-btn {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .month-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

/* Animation for calendar update */
.admin-calendar {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* --- Booking Tabs --- */
.booking-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}
.tab-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    font-size: 1rem;
    color: #888;
    cursor: pointer;
    border-radius: 8px;
    transition: 0.3s;
    font-weight: 600;
}
.tab-btn.active {
    background: #e6fffa;
    color: #00b894;
}
.tab-btn:hover:not(.active) {
    background: #f5f5f5;
    color: #555;
}

/* --- Booking Toolbar (แก้ใหม่ ป้องกันการทับกัน) --- */
.booking-toolbar {
    display: flex;
    flex-wrap: wrap; /* สำคัญ! ให้ตกลงมาบรรทัดใหม่ถ้าที่เต็ม */
    gap: 15px; /* เพิ่มระยะห่างหน่อย */
    margin-bottom: 20px;
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    align-items: center;
}

.search-box {
    position: relative;
    flex: 1 1 250px; /* ยืดหยุ่นได้ แต่มีความกว้างขั้นต่ำ 250px */
    max-width: 400px; /* จำกัดความกว้างสูงสุด ไม่ให้ยาวเฟื้อยไปทับชาวบ้าน */
    margin-right: auto; /* ดันตัวกรองไปชิดขวา */
}

.search-box i { 
    position: absolute; 
    left: 12px; 
    top: 50%; 
    transform: translateY(-50%); 
    color: #aaa; 
}

.search-box input {
    width: 100%; 
    padding: 10px 10px 10px 35px; 
    border: 1px solid #ddd; 
    border-radius: 8px; 
    outline: none;
    box-sizing: border-box; /* สำคัญ! ให้ padding รวมอยู่ในความกว้าง */
}

/* ส่วน Filter Group ปรับให้ไม่ขยายจนเบียด */
.filter-group {
    flex: 0 0 auto; /* ไม่ต้องยืด */
}

/* --- Mobile Menu Toggle --- */
.mobile-header { display: none; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.btn-menu-toggle { display: none; background: #333; color: white; border: none; padding: 10px; border-radius: 6px; font-size: 1.2rem; }

/* =======================================================
   📱 MOBILE ULTIMATE FIX (แยกโลกมือถือ 100%)
   ======================================================= */
/* =======================================================
   📱 MOBILE ULTIMATE FIX (แก้จบเรื่องแถบดำโผล่ 100%)
   ======================================================= */
/* =======================================================
   💻 DESKTOP VERSION (หน้าตาเดิมที่แมนต้องการ)
   ======================================================= */
:root {
    --sidebar-bg: #1e1e2d;
    --sidebar-text: #a6a6c0;
    --primary: #00C853;
    --bg: #f5f8fa;
}

body { 
    font-family: 'Kanit', sans-serif; 
    margin: 0; 
    background: var(--bg); 
    display: flex; 
    height: 100vh; 
    overflow: hidden; 
}

/* 🚫 ซ่อน Mobile Header บนหน้าจอคอมเสมอ */
.mobile-header { display: none !important; }

/* Dashboard Layout */
#dashboard-section { display: flex; width: 100%; height: 100%; }
.sidebar { 
    width: 250px; 
    background: var(--sidebar-bg); 
    color: white; 
    display: flex; 
    flex-direction: column; 
    padding: 20px; 
    flex-shrink: 0; 
    transition: transform 0.3s ease; 
}

.logo { font-size: 1.5rem; font-weight: bold; margin-bottom: 40px; color: white; text-align: center; }
.menu { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; height: 100%; }
.menu li { 
    padding: 15px; 
    margin-bottom: 5px; 
    cursor: pointer; 
    border-radius: 8px; 
    color: var(--sidebar-text); 
    transition: 0.2s; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
}
.menu li:hover, .menu li.active { background: #2b2b40; color: white; }

.main-content { 
    flex: 1; 
    padding: 30px; 
    overflow-y: auto; 
    position: relative; 
}

.page-section { display: none; }
.page-section.active { display: block; animation: fadeIn 0.3s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- Table Desktop Style (หน้าตาเดิม) --- */
.table-responsive { 
    background: white; 
    border-radius: 12px; 
    padding: 20px; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); 
    overflow-x: auto; 
}
.data-table { width: 100%; border-collapse: collapse; min-width: 800px; }
.data-table th, .data-table td { text-align: left; padding: 12px; border-bottom: 1px solid #eee; }
.data-table th { color: #888; font-weight: 500; font-size: 0.9rem; }

/* --- Calendar Desktop Grid (หน้าตาเดิม) --- */
.admin-calendar { 
    display: grid; 
    grid-template-columns: repeat(7, 1fr); 
    gap: 10px; 
    margin-top: 20px; 
}
.cal-day { 
    min-height: 100px; 
    padding: 10px; 
    border-radius: 12px; 
    border: 1px solid #eee; 
    background: white; 
    cursor: pointer; 
    display: flex; 
    flex-direction: column; 
    justify-content: space-between; 
}

/* =======================================================
   📱 MOBILE VERSION (Media Query สำหรับมือถือ)
   ======================================================= */
@media (max-width: 900px) {
    /* 1. Sidebar Fix: ซ่อนเนียนๆ ห้ามมีแถบดำโผล่ */
    .sidebar { 
        position: fixed; 
        left: 0; 
        transform: translateX(-110%); /* ดีดออกไปนอกจอ */
        z-index: 9999; 
        height: 100vh; 
        visibility: hidden; 
    }
    .sidebar.open { 
        transform: translateX(0); 
        visibility: visible; 
        box-shadow: 10px 0 30px rgba(0,0,0,0.3);
    }
    
    .main-content { 
        padding: 15px; 
        width: 100% !important; 
        max-width: 100vw; 
        overflow-x: hidden; 
    }
    .desktop-only-header { display: none !important; }

    /* 2. ✅ Mobile Header: โชว์เฉพาะบนมือถือ */
    .mobile-header { 
        display: flex !important; 
        flex-direction: column; 
        gap: 10px; 
        margin-bottom: 20px; 
        background: white; 
        padding: 18px; 
        border-radius: 16px; 
        box-shadow: 0 4px 15px rgba(0,0,0,0.05); 
    }
    .header-top-row { display: flex !important; justify-content: space-between; align-items: center; width: 100%; }
    .btn-menu-toggle { 
        display: flex !important; 
        align-items: center; 
        justify-content: center; 
        background: #f0f2f5; 
        width: 42px; 
        height: 42px; 
        border-radius: 10px; 
        border: none; 
        font-size: 1.3rem; 
        cursor: pointer;
    }

    /* 3. 🔥 ตารางเปลี่ยนร่างเป็นการ์ด (Card View) */
    .table-responsive { padding: 0; background: transparent; box-shadow: none; }
    .data-table { min-width: 0 !important; width: 100% !important; display: block; border: none; }
    .data-table thead { display: none; } 
    .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; box-sizing: border-box; }
    .data-table tr { 
        margin-bottom: 15px; 
        background: white; 
        border-radius: 16px; 
        padding: 15px; 
        border: 1px solid #f0f0f0; 
        box-shadow: 0 4px 10px rgba(0,0,0,0.03); 
    }
    .data-table td { 
        display: flex; 
        justify-content: space-between; 
        align-items: center; 
        padding: 10px 0; 
        border-bottom: 1px solid #f9f9f9; 
        text-align: right; 
    }
    .data-table td::before { 
        content: attr(data-label); 
        font-weight: 600; 
        color: #888; 
        text-align: left; 
    }

    /* 4. 🔥 ปฏิทินแบบแนวตั้ง (Agenda View) */
    .admin-calendar { display: flex !important; flex-direction: column; gap: 12px; }
    .cal-header { display: none !important; }
    .cal-day { 
        display: flex !important; 
        flex-direction: row; 
        min-height: auto; 
        padding: 15px; 
        align-items: center;
    }
    .cal-date { 
        width: 50px; 
        border-right: 2px solid #f0f0f0; 
        margin-right: 15px; 
        margin-bottom: 0; 
        font-size: 1.4rem; 
        font-weight: bold;
    }
    .cal-info { flex: 1; text-align: left; justify-content: space-between; }
}

/* --- Status & Helpers (ใช้ร่วมกัน) --- */
.status-badge { padding: 4px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.status-confirmed { background: #e6fffa; color: #00b894; border: 1px solid #b2f5ea; }
.status-payment_review { background: #fff8e1; color: #ffa000; border: 1px solid #ffe082; }
.status-waiting_payment { background: #f3f0ff; color: #845ef7; border: 1px solid #e5dbff; }
.status-cancelled { background: #fff5f5; color: #e03131; border: 1px solid #ffc9c9; }

/* --- Cyberpunk Theme (Settings) --- */
.cyber-card { 
    background: rgba(20, 20, 30, 0.9); 
    padding: 40px; 
    border-radius: 15px; 
    border: 1px solid rgba(0, 200, 83, 0.3); 
    width: 400px; 
    max-width: 100%;
}

/* --- ปุ่ม Cyberpunk แยกสีบ้าน --- */
.btn-cyber-save.btn-villa-1:hover {
    background: #1565c0 !important;
    color: #fff !important;
    box-shadow: 0 0 20px #1565c0 !important;
}
.btn-cyber-save.btn-villa-2:hover {
    background: #7b1fa2 !important;
    color: #fff !important;
    box-shadow: 0 0 20px #7b1fa2 !important;
}
.input-villa-1 input:focus ~ label, .input-villa-1 input:valid ~ label { color: #1565c0 !important; text-shadow: 0 0 5px #1565c0 !important; }
.input-villa-2 input:focus ~ label, .input-villa-2 input:valid ~ label { color: #7b1fa2 !important; text-shadow: 0 0 5px #7b1fa2 !important; }