: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; /* โค้งมนเหมือน App */
    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); }

.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;}

/* 🟢 ว่าง (Available) - สีเขียวแบบ Flatpickr */
.cal-day.available { 
    background-color: #f0fff4; /* เขียวอ่อนจางๆ พื้นหลัง */
    border: 1px solid #00C853; /* ขอบเขียว */
    color: #00C853;
}
.cal-day.available .cal-info { background: #00C853; color: white; }

/* 🔴 จองแล้ว (Confirmed) - สีแดงแบบ Flatpickr */
.cal-day.booked { 
    background-color: #fff1f0; 
    border: 1px solid #ff4d4f; 
    color: #ff4d4f;
}
.cal-day.booked .cal-info { background: #ff4d4f; color: white; }

/* 🟠 รอยืนยัน (Pending) - สีส้ม */
.cal-day.pending { 
    background-color: #fff7e6; 
    border: 1px solid #ffa940; 
    color: #d46b08;
}
.cal-day.pending .cal-info { background: #ffa940; color: white; }

/* ⚫ ปิดห้อง (Blocked) */
.cal-day.blocked { 
    background-color: #333; 
    border: 1px solid #000; 
    color: #ccc;
}
.cal-day.blocked .cal-info { background: #555; color: white; }

/* ⚪ วันที่ผ่านมาแล้ว (Past) */
.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; }


/* ... (CSS ส่วนอื่นๆ เหมือนเดิม) ... */

/* ✨ 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; }