: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;
}

/* 1️⃣ กล่องปฏิทินให้สูงขึ้น */
.cal-day {
    min-height: 140px;
    padding: 15px;
    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;
}

.cal-day:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 2️⃣ ตัวเลขวันที่ให้ใหญ่สะใจ */
.cal-date {
    font-weight: bold;
    font-size: 1.6rem;
    margin-bottom: 5px;
}

/* สไตล์พื้นฐานของป้ายชื่อในปฏิทิน */
.cal-info {
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
    cursor: pointer;
    transition: 0.2s;
    font-weight: 500;
}

.cal-info:hover {
    filter: brightness(0.9);
    transform: scale(1.02);
}
/* ⚪ ฝั่งคนออก (สีเทา) */
.cal-info.out-guest {
    background-color: #6c757d !important; /* สีเทาเข้ม */
    color: white !important;
    border-left: 4px solid #343a40;
}

/* 🔴 ฝั่งคนเข้า (สีแดง) */
.cal-info.in-guest {
    background-color: #e03131 !important; /* สีแดง */
    color: white !important;
    border-left: 4px solid #901010;
}

/* ปรับฟอนต์ให้เล็กลงเวลาอยู่บนมือถือ เพื่อไม่ให้ล้น */
@media (max-width: 900px) {
    .cal-day {
        min-height: auto;
        padding: 5px !important;
    }
    .cal-date {
        font-size: 1rem !important;
        margin-bottom: 2px;
    }
    .cal-info {
        font-size: 0.7rem;
        padding: 3px 5px;
    }
    .cal-info i {
        font-size: 0.6rem;
    }
}

/* 🟢 ว่าง (ปรับให้เป็นกล่องสีขาว คลีนๆ ตามคำสั่งหัวหน้า) */
.cal-day.available {
    background-color: #ffffff;
    border: 1px solid #eee; /* ขอบสีเทาอ่อนให้กลืนๆ ไป */
    color: #333; /* สีตัวเลขวันที่เป็นสีดำปกติ */
}

/* เพิ่ม Hover เอฟเฟกต์นิดนึง เพื่อให้แอดมินรู้ว่า "ช่องว่างๆ นี้มันยังกดได้นะ" */
.cal-day.available:hover {
    background-color: #f8f9fa;
    border-color: #00C853; /* แอบขึ้นขอบเขียวตอนเอาเมาส์ชี้ จะได้ดูมีอะไร */
}

.cal-day.available .cal-info {
    background: #00C853;
    color: white;
}

/* 🔴 จองแล้ว */
.cal-day.booked {
    background-color: #ffffff; /* พื้นหลังสีขาว */
    border: 1px solid #ff4d4f; /* คงขอบสีแดงไว้ */
    color: #333; /* เปลี่ยนเลขวันที่เป็นสีดำ จะได้อ่านง่าย */
}

.cal-day.booked .cal-info {
    background: #ff4d4f;
    color: white;
}

/* 🟠 รอยืนยัน */
.cal-day.pending {
    background-color: #ffffff; /* พื้นหลังสีขาว */
    border: 1px solid #ffa940; /* คงขอบสีส้มไว้ */
    color: #333; /* เปลี่ยนเลขวันที่เป็นสีดำ */
}

.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 --- */

/* วันที่มีทั้งคนออกและคนเข้า (Swap Day) */
.cal-day.swap {
    background-color: #ffffff !important; /* พื้นหลังสีขาว */
    border: 1px solid #dee2e6 !important;
}

.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;
}

/* --- SETTINGS THEME (Modernized) --- */
/* Kept clean, styling is inline in index.html for simplicity during this transition */
/* ===== 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 (หน้าตาเดิมที่แมนต้องการ)
   ======================================================= */


/* 🚫 ซ่อน 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%;
}


/* --- Admin Manual Booking Form Styles --- */
.counter-box {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 20px;
    overflow: hidden;
    background: white;
}

.counter-box button {
    background: transparent;
    border: none;
    width: 35px;
    height: 35px;
    font-size: 1.2rem;
    cursor: pointer;
    color: #555;
    transition: 0.2s;
}

.counter-box button:hover {
    background: #f0f0f0;
}

.counter-box input {
    width: 40px;
    text-align: center;
    border: none;
    font-weight: bold;
    font-size: 1rem;
    outline: none;
    background: transparent;
    pointer-events: none; /* กันพิมพ์มั่ว */
}


/* --- Admin Calendar Manual Booking Status (สีบอกสถานะในปฏิทิน) --- */
.flatpickr-day.status-available {
    background-color: #00C853 !important;
    border-color: #00C853 !important;
    color: white !important;
}
.flatpickr-day.status-booked {
    background-color: #ff4d4f !important;
    border-color: #ff4d4f !important;
    color: white !important;
}
.flatpickr-day.status-pending {
    background-color: #ffa940 !important;
    border-color: #ffa940 !important;
    color: white !important;
}
.flatpickr-day.status-blocked {
    background-color: #4a4a4a !important; 
    border-color: #4a4a4a !important;
    color: #aaaaaa !important;
    text-decoration: line-through; 
}

/* ==========================================
   🎨 MODERN BOOKING LEGEND & DATE INPUT 
   ========================================== */
.admin-booking-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    padding: 12px;
    background: #f8f9fa; /* พื้นหลังสีเทาอ่อนให้ดูเป็นโซน */
    border-radius: 12px;
    border: 1px solid #eaeaea;
}

.admin-booking-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #555;
    padding: 6px 12px;
    background: white;
    border-radius: 30px; /* ทำขอบมนให้เป็นแคปซูล */
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    border: 1px solid #f0f0f0;
    transition: 0.2s;
}

.admin-booking-legend .legend-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.admin-booking-legend .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 2px rgba(255,255,255,0.6); /* เพิ่มขอบขาวด้านในให้ดูมีมิติ */
}

/* ใส่สีและแสงเรืองรองนิดๆ ให้ดูพรีเมียม */
.admin-booking-legend .dot.green { background: #00C853; box-shadow: 0 0 8px rgba(0,200,83,0.4); }
.admin-booking-legend .dot.orange { background: #ffa940; box-shadow: 0 0 8px rgba(255,169,64,0.4); }
.admin-booking-legend .dot.red { background: #ff4d4f; box-shadow: 0 0 8px rgba(255,77,79,0.4); }
.admin-booking-legend .dot.black { background: #4a4a4a; box-shadow: 0 0 8px rgba(74,74,74,0.4); }

/* --- สไตล์ช่องเลือกวันที่แบบ Modern --- */
.date-input-wrapper {
    position: relative;
    width: 100%;
}

.date-input-wrapper i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #00C853;
    font-size: 1.2rem;
    pointer-events: none; /* ป้องกันการคลิกโดนไอคอน */
}

.modern-date-input {
    width: 100%;
    padding: 16px 20px 16px 45px !important; /* เว้นที่ด้านซ้ายให้ไอคอน */
    font-size: 1.1rem !important;
    font-weight: 500;
    color: #333;
    background-color: #ffffff;
    border: 2px solid #e0e0e0 !important;
    border-radius: 12px !important;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
    cursor: pointer;
    box-sizing: border-box;
    font-family: 'Kanit', sans-serif;
    text-align: left !important;
}

.modern-date-input:hover {
    border-color: #00C853 !important;
    box-shadow: 0 6px 15px rgba(0,200,83,0.1);
}

.modern-date-input:focus {
    outline: none;
    border-color: #00C853 !important;
    box-shadow: 0 0 0 4px rgba(0,200,83,0.15); /* วงแหวนสีเขียวตอนคลิก */
}
/* --- ปิดเอฟเฟกต์ซูมและเด้ง สำหรับกล่องฟอร์ม --- */
.settings-container .hero-card:hover {
    transform: none !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important; /* กลับไปใช้เงาขนาดปกติ */
}