body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f8f9fa;
    color: #212529;
    margin: 0;
}

h1, h2 {
    text-align: center;
}

/* --- Styles for Main Header & Room Cards (index.html) --- */
.main-header {
    position: relative;
    text-align: center;
    color: white;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px 40px;
    box-sizing: border-box;
    background-color: #ffffff; 
}

#header-video {
    position: absolute;
    top: 12%;
    left: 0;
    min-width: 100%;
    min-height: 100%;
    /*width: auto;*/
    /*  height: auto;*/
    /*z-index: -1;*/
    /*transform: translateX(-50%) translateY(-50%);*/
    /*background-size: cover;*/
    object-fit: cover;
    filter: brightness(0.5);
}

.header-content {
    position: relative;
    z-index: 1;
    flex-grow: 1; 
    display: flex; 
    flex-direction: column;
}

.logo {
    max-height: 480spx;
    margin-bottom: 60px;
}

.main-header h1 {
    font-size: 3rem;
    margin: 0;
}

.main-header p {
    font-size: 1.2rem;
}

.section-title {
    text-align: center;
    margin: 40px 0 20px 0;
    color: #495057;
}

.rooms-section {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 20px;
    flex-wrap: wrap;
}

.room-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 6px 12px rgba(0,0,0,0.08);
    width: 400px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.room-image {
    height: 220px;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 20px;
    color: white;
    font-size: 1.8em;
    font-weight: bold;
    background-size: cover;
    background-position: center;
    position: relative;
}

.room-image::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 50%);
}

.room-image h3 {
    margin: 0;
    z-index: 1;
}

.room-image.double-bed {
    background-image: url('Single_Bed_Room.jpg'); 
}

.room-image.twin-beds {
    background-image: url('Twin_Beds_Room.jpg');
}

.room-details {
    padding: 20px;
}

.room-details p {
    color: #6c757d;
    font-size: 0.95em;
    line-height: 1.5;
}

.book-now-btn {
    width: 100%;
    padding: 12px;
    background-color: #0d6efd;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: background-color 0.2s;
}

.book-now-btn:hover {
    background-color: #0b5ed7;
}

.admin-link {
    display: inline-block;
    margin-top: 15px;
    padding: 8px 15px;
    background-color: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.9em;
    transition: background-color 0.2s;
}

.admin-link:hover {
    background-color: #5a6268;
}

/* --- Features Section (index.html) --- */
.features-section {
    padding: 40px 20px;
    background-color: #ffffff;
}
.features-container {
    display: flex;
    justify-content: center;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
}
.feature-item {
    text-align: center;
    flex-basis: 260px;
}
.feature-item i {
    font-size: 2.5rem;
    color: #d0c60d;
    margin-bottom: 15px;
}
.feature-item h3 {
    font-size: 1.25rem;
    margin-bottom: 10px;
    color: #343a40;
}
.feature-item p {
    color: #6c757d;
    line-height: 1.6;
}

/* --- Footer (index.html) --- */
.site-footer {
    background-color: #343a40;
    color: #adb5bd;
    text-align: center;
    padding: 30px 20px;
    font-size: 0.9em;
}
.site-footer p { margin: 5px 0; }
.site-footer strong { color: #f8f9fa; }

#admin-pms-btn {
    color: #838d96;
    text-decoration: underline;
    margin-left: 20px;
    cursor: pointer;
    transition: color 0.2s;
}
#admin-pms-btn:hover {
    color: #ffffff;
}


/* --- Styles for Admin Page (pms.html) --- */
.section-divider {
    border: 0;
    height: 1px;
    background: #e0e0e0;
    margin: 20px 5%;
}

.container {
    display: flex;
    flex-wrap: wrap; 
    gap: 20px;
    padding: 20px;
}

.form-container, .status-container {
    flex-shrink: 0;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    align-self: flex-start;
}

.form-container { 
    flex-basis: 300px; 
    flex-grow: 1;
}
.status-container { 
    flex-basis: 250px;
    flex-grow: 1;
}

.form-container label { display: block; margin-top: 10px; }
.form-container input, .form-container select, .form-container button {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    border-radius: 4px;
    border: 1px solid #ccc;
    box-sizing: border-box;
}
.form-container button {
    background-color: #007bff;
    color: white;
    border: none;
    cursor: pointer;
    margin-top: 20px;
}

.required-asterisk {
    color: red;
    margin-left: 4px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}
.status-item span { font-weight: bold; }
.status-item button {
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #17a2b8;
    color: white;
}

.calendar-wrapper {
    flex-basis: 100%;
    margin-top: 20px;
}
.calendar-container {
    flex-grow: 1;
    overflow-x: auto;
}
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px 10px 10px;
}
.calendar-header h2 { margin: 0; }

#timeline-grid {
    display: grid;
    position: relative;
    border: 1px solid #ccc;
    background: white;
}
.grid-header, .grid-room-label, .grid-day {
    padding: 10px;
    text-align: center;
    border-right: 1px solid #eee;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
    background-color: white;
}
.grid-header.grid-room-label, .grid-room-label {
    font-weight: bold;
    background-color: #f1f1f1;
    position: sticky;
    left: 0;
    z-index: 10;
}
.grid-header.grid-room-label { z-index: 20; }

#booking-container {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
.grid-booking {
    position: absolute;
    background-color: #007bff;
    color: white;
    padding: 5px;
    border-radius: 4px;
    font-size: 12px;
    overflow: hidden;
    white-space: nowrap;
    cursor: pointer;
    z-index: 5;
    pointer-events: auto;
    box-sizing: border-box;
}

/* --- Shared Modal Styles --- */
.modal-hidden {
    display: none; /* <-- ต้องเป็น none นะครับ (นี่คือสถานะ "ซ่อน") */
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    overflow: hidden; /* <-- เปลี่ยนเป็น hidden (กันหน้าเว็บเลื่อน) */
    background-color: rgba(0,0,0,0.5);
}

/* เพิ่มคลาสใหม่นี้เข้าไปต่อท้าย .modal-hidden 
  นี่คือสไตล์ "ตอนเปิด" ที่ถูกต้อง
*/
#quick-book-modal.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
}


.modal-visible {
    visibility: visible;
    opacity: 1;
}
.modal-content {
    background-color: #fefefe;
    /* margin: 5% auto; <-- ลบบรรทัดนี้ทิ้ง (นี่คือตัวปัญหา) */
    overflow-y: auto; /* <-- เพิ่มตัวนี้ (ให้กล่องสีขาวเลื่อนได้เอง) */
    max-height: 90vh; /* <-- เพิ่มตัวนี้ (กันกล่องสูงทะลุจอ) */
    padding: 25px;
    border: 1px solid #888;
    width: 90%;
    max-width: 700px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}
.close-button {
    color: #aaa;
    position: absolute;
    top: 10px; right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.close-button:hover {
    color: #000;
}

/* === Quick Book Modal Styles === */
#quick-book-modal .form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}
#quick-book-modal .form-group {
    flex: 1;
    min-width: 0;
}
#quick-book-modal .form-group.full-width {
    flex-basis: 100%;
    margin-bottom: 15px;
}
#quick-book-modal label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9em;
    color: #333;
    font-weight: 500;
}
#quick-book-modal input, #quick-book-modal select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1rem;
}
#quick-book-modal input[type="file"] {
    padding: 8px;
}

#quick-book-modal .form-group-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
}
#quick-book-modal .form-group-checkbox label {
    margin-bottom: 0;
}

#quick-book-modal .form-divider {
    border: none;
    border-top: 1px solid #eee;
    margin: 20px 0;
}

#quick-book-modal .form-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.3em;
    margin: 20px 0;
    padding-top: 15px;
}
#quick-book-modal .form-total strong { color: #333; }
#quick-book-modal #quick-total-price { font-weight: bold; color: #000; }
#quick-book-modal .form-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}
#quick-book-modal .form-buttons button {
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
}
#quick-book-modal .cancel-btn { 
    background-color: #e0e0e0;
    color: #333;
}
#quick-book-modal .confirm-btn { 
    background-color: #28a745; 
    color: white; 
}


/****************************************************************/
/* --- NEW & UPDATED STYLES FOR 'MINIMALIST HOTEL' DESIGN --- */
/****************************************************************/

.navbar { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.navbar .logo { display: flex; align-items: center; gap: 15px; }
.navbar .logo img { 
    max-height: 80px; 
}
.nav-links { list-style: none; display: flex; gap: 30px; margin: 0; padding: 0; align-items: center; }
.nav-links a { color: rgb(3, 3, 3); text-decoration: none; font-size: 0.9rem; font-weight: 500; letter-spacing: 1px; transition: color 0.3s; }
.nav-links a:hover { color: #f76d6d; }

.hero-text { flex-grow: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; color: white; }
.hero-text h1 { font-size: 4rem; margin-bottom: 15px; font-weight: 600; letter-spacing: 2px; }
.hero-text p { font-size: 1.1rem; max-width: 500px; margin-bottom: 30px; }
.view-more-btn { padding: 12px 30px; border: 2px solid white; color: white; text-decoration: none; font-weight: bold; transition: background-color 0.3s, color 0.3s; }
.view-more-btn:hover { background-color: white; color: black; }

.about-us-section {
    background-color: #2c2c2c;
    color: #e0e0e0;
    padding: 80px 40px;
}
.about-content {
    display: flex;
    align-items: center;
    gap: 50px;
    max-width: 1200px;
    margin: 0 auto;
}
.about-text {
    flex: 1;
    text-align: left;
}
.about-text h3 {
    font-size: 1rem;
    font-weight: 400;
    color: #bbbbbb;
    margin-bottom: 5px;
}
.about-text h2 {
    text-align: left;
    font-size: 2.5rem;
    color: white;
    margin-bottom: 20px;
}
.about-text p {
    line-height: 1.7;
    margin-bottom: 30px;
}

/* === 🌟 Restored Auto-Scrolling Gallery Styles 🌟 === */
.about-images {
    flex: 1.2;
    height: 400px;
    overflow: hidden;
    position: relative;
    border-radius: 8px;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
}

.image-scroller {
    display: flex;
    height: 100%;
    will-change: transform;
    animation-name: scroll;
    animation-duration: 60s; /* Slower speed */
    animation-iteration-count: infinite;
    animation-timing-function: linear;
}

.image-scroller:hover {
    animation-play-state: paused;
}

.image-scroller img {
    height: 100%;
    width: auto;
    object-fit: cover;
    padding-right: 15px;
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}


.logo { margin-bottom: 0; }
.main-header h1, .main-header p { text-align: left; }
.rooms-container {
    padding: 20px 0;
}
.section-title {
    font-size: 1.8rem;
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .hero-text h1 { font-size: 2.5rem; }
    .hero-text p { font-size: 1rem; }
    .about-content { flex-direction: column; }
    .about-text h2 { font-size: 2rem; }
    
    .about-images {
        width: 100%;
        height: auto;
        overflow: visible;
        -webkit-mask-image: none;
    }

    .image-scroller {
        animation: none;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        width: 100%;
        position: static;
    }

    .image-scroller img {
        width: 100%;
        height: 100%;
        aspect-ratio: 4 / 3;
        object-fit: cover;
        padding-right: 0;
        border-radius: 8px;
    }

    .rooms-section { flex-direction: column; align-items: center; }
    .room-card { width: 90%; max-width: 400px; }
    #quick-book-modal .form-row { flex-direction: column; gap: 15px; margin-bottom: 0; }
    #quick-book-modal .form-group { margin-bottom: 15px; }
}

/* --- สไตล์สำหรับ Header ของหน้า PMS โดยเฉพาะ --- */
.pms-header {
    background-image: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url('YOUR_ADMIN_BACKGROUND.jpg');
    background-size: cover;
    background-position: center;
    height: auto; 
    padding: 50px 20px;
    display: block;
}

.pms-header h1 {
    color: white;
    margin: 0 0 20px 0;
}

/* --- Language Switcher Styles --- */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 20px; /* Add some space from other nav items */
}

.lang-switcher span {
    color: #6c757d; /* A neutral color for the separator */
}

.lang-link {
    font-weight: bold;
    color: #a0a0a0; /* Dimmer color for inactive language */
    text-decoration: none;
    transition: color 0.3s;
}

.lang-link.active {
    color: #9214ed; /* White color for the active language */
    text-decoration: underline;
}

/* --- Professional Dashboard Styles (pms.html) --- */
.dashboard-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 25px;
    background-color: #f8f9fa; /* Light grey background */
}

.dashboard-card {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 5px solid #ccc; /* Default border color */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.card-content h4 {
    margin: 0 0 5px 0;
    color: #f0f1f2;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
}

.card-content p {
    margin: 0;
    font-size: 2.2rem;
    font-weight: 700;
    color: #212529;
}

.card-content small {
    color: #adb5bd;
    font-size: 0.8rem;
}

.card-icon i {
    font-size: 3rem;
    color: #dee2e6;
}

/* Color Coding */
.card-occupancy { border-color: #495057; }
.card-rate { border-color: #198754; }
.card-arrivals { border-color: #0d6efd; }
.card-departures { border-color: #dc3545; }

/* --- Gallery Page Styles --- */
.page-header {
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url('LobbyAI.png');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 20px 40px;
    text-align: center;
}

.page-header .navbar .nav-links a {
    color: white;
}

.page-header-title {
    padding: 60px 0;
}

.page-header-title h1 {
    font-size: 3.5rem;
    margin: 0;
}

.page-header-title p {
    font-size: 1.1rem;
    color: #e0e0e0;
}

.gallery-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* ======== FINAL CORRECTED DASHBOARD STYLES (v4) ======== */

/* --- Main Header and Tab Navigation --- */
.dashboard-header { padding: 20px 40px; height: auto; }
.pms-header.dashboard-header .header-top-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.pms-header.dashboard-header h1 { margin: 0; text-align: left; }
.header-left, .header-right { display: flex; align-items: center; gap: 20px; }
#current-datetime { color: #e0e0e0; font-size: 0.9em; background-color: rgba(0,0,0,0.2); padding: 5px 12px; border-radius: 4px; }
.date-navigator { display: flex; align-items: center; gap: 10px; }
.date-nav-btn { background-color: rgba(255, 255, 255, 0.1); color: white; border: 1px solid rgba(255, 255, 255, 0.3); padding: 6px 12px; border-radius: 4px; cursor: pointer; transition: background-color 0.2s; }
.date-nav-btn:hover { background-color: rgba(255, 255, 255, 0.2); }
#db-date-range { color: white; font-weight: 500; }
.pms-tabs { display: flex; gap: 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.2); }
.tab-link { padding: 12px 20px; color: #e0e0e0; text-decoration: none; font-weight: 500; border-bottom: 3px solid transparent; display: flex; align-items: center; gap: 8px; }
.tab-link.active { color: #ffffff; border-bottom-color: #ffffff; }
.tab-content { display: none; padding: 20px 40px; }
.tab-content.active { display: block; }

/* --- KPI Card Container (for the top row) --- */
.kpi-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 25px;
}

/* --- Main Dashboard Grid Container (for lists and chart) --- */
.dashboard-grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two equal columns for the lists */
    gap: 25px;
}

/* --- Base Style for ALL Cards (Standard and Flip) --- */
.db-card {
    border-radius: 8px; color: white; position: relative; display: flex;
    align-items: center; justify-content: space-between; padding: 25px;
    min-height: 110px; box-sizing: border-box;
}

/* --- Content and Icon Layout (Used by ALL Cards) --- */
.card-content { flex-grow: 1; }
.card-content p { font-size: 2.5rem; font-weight: 700; margin: 0 0 5px 0; }
.card-content h4 { margin: 0; font-weight: 500; opacity: 1; font-size: 0.9rem; }
.card-icon i { font-size: 3rem; opacity: 0.3; }

/* --- Flip Card Specific Styles --- */
.db-card.flip-card { padding: 0; background-color: transparent; perspective: 1000px; cursor: pointer; }
.flip-card-inner { position: relative; width: 100%; height: 100%; transition: transform 0.6s; transform-style: preserve-3d; }
.db-card.flip-card.is-flipped .flip-card-inner { transform: rotateY(180deg); }
.flip-card-front, .flip-card-back {
    position: absolute; width: 100%; height: 100%; -webkit-backface-visibility: hidden;
    backface-visibility: hidden; border-radius: 8px; padding: 25px; box-sizing: border-box;
    display: flex; justify-content: space-between; align-items: center;
}
.flip-card-back { transform: rotateY(180deg); }
.card-footer-hint { position: absolute; bottom: 10px; left: 25px; font-size: 0.8em; opacity: 0.8; }

/* --- Card Color Palette --- */
.flip-card-front.card-blue { background-color: #0d6efd; }
.db-card.card-yellow { background-color: #ffc107; }
.db-card.card-red { background-color: #dc3545; }
.flip-card-front.card-green { background-color: #198754; }
.flip-card-back.card-blue { background-color: #0d6efd; }
.flip-card-back.card-purple { background-color: #6f42c1; }
.flip-card-back.card-orange { background-color: #fd7e14; }
.flip-card-back.card-teal { background-color: #20c997; }
.flip-card-back.card-indigo { background-color: #6610f2; }
.flip-card-back.card-pink { background-color: #d63384; }

/* --- Other Dashboard Components --- */
.pms-list-card {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    padding: 20px;
}
.chart-card {
    grid-column: 1 / -1; /* This makes ONLY the chart span the full width */
}
.pms-list-card h3 { margin-top: 0; border-bottom: 1px solid #eee; padding-bottom: 10px; }
.list-table-container { max-height: 250px; overflow-y: auto; }
.pms-list-card table { width: 100%; border-collapse: collapse; }
.pms-list-card th, .pms-list-card td { text-align: left; padding: 10px; border-bottom: 1px solid #f0f0f0; }
.pms-list-card th { font-weight: 600; font-size: 0.9em; color: #6c757d; }
.status-badge { padding: 3px 8px; border-radius: 12px; font-size: 0.8em; font-weight: 500; color: #fff; }
.status-badge.status-arrival { background-color: #0d6efd; }
.status-badge.status-departure { background-color: #dc3545; }
.chart-container { height: 250px; }
.report-placeholder { text-align: center; padding: 50px; color: #6c757d; }

/* --- Responsive Media Queries for Dashboard --- */
@media (max-width: 1400px) {
    .dashboard-grid-container { grid-template-columns: 1fr; } /* Stack lists on smaller desktops */
}

@media (max-width: 768px) {
    .header-left, .header-right { flex-basis: 100%; justify-content: center; }
    .header-right { margin-top: 15px; }
}

/* ======== REPORT PAGE STYLES ======== */

.report-container {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.report-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

.report-controls label {
    margin-right: 10px;
    font-weight: 500;
    color: #495057;
}

.report-controls input[type="date"] {
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    margin-right: 20px;
}

.report-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.action-btn.secondary-btn {
    background-color: #6c757d;
    color: white;
}
.action-btn.secondary-btn:hover {
    background-color: #5a6268;
}

#generate-report-btn {
    background-color: #198754;
    color: white;
}
#generate-report-btn:hover {
    background-color: #157347;
}

.hidden {
    display: none !important;
}

#report-period-title {
    text-align: left;
    margin-top: 0;
    margin-bottom: 25px;
}

.report-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.report-kpi-card {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 5px solid #0d6efd;
}

.report-kpi-card h4 {
    margin: 0 0 10px 0;
    font-size: 1rem;
    color: #6c757d;
}

.report-kpi-card p {
    margin: 0;
    font-size: 2rem;
    font-weight: 600;
    color: #212529;
}

.report-section {
    margin-bottom: 30px;
}
.report-section h4 {
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}
.report-chart-container {
    height: 350px;
}
.report-tables-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}
.report-section table {
    width: 100%;
    border-collapse: collapse;
}
.report-section th, .report-section td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
}
.report-section th {
    background-color: #f8f9fa;
}

@media print {
    body, .tab-content.active, .report-container {
        background: #fff !important;
        box-shadow: none !important;
    }
    .pms-header, .report-controls {
        display: none !important;
    }
    .report-tables-grid {
        grid-template-columns: 1fr; /* Stack tables when printing */
    }
}

/* --- Weather Forecast Styles --- */
.grid-header {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    line-height: 1;
    padding: 5px; /* Adjust padding */
}

.weather-forecast {
    display: flex;
    align-items: center;
    gap: 2px;
}

.weather-forecast img {
    width: 28px;
    height: 28px;
}

.weather-forecast span {
    font-size: 0.85em;
    font-weight: 500;
    color: #495057;
}

/* --- Styles for Top Occupied Rooms Report --- */
.top-rooms-section {
    grid-column: 1 / -1; /* Make this section span the full width */
}

.progress-bar {
    width: 100px;
    height: 12px;
    background-color: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    display: inline-block;
    margin-right: 10px;
    vertical-align: middle;
}

.progress {
    height: 100%;
    background-color: #0d6efd;
    transition: width 0.4s ease-in-out;
}

/* --- Calendar Highlight and Holiday Styles --- */

.grid-header.weekend, .grid-day.weekend {
    background-color: #f7f7f7; /* Light grey for weekends */
}

.holiday-remark {
    font-size: 9px;
    font-weight: 500;
    color: #dc3545; /* Red color for holidays */
    line-height: 1.1;
    margin-top: 2px;
    white-space: normal; /* Allow text to wrap */
}

/* --- Booking Tooltip Styles --- */
.booking-tooltip {
    display: none;
    position: absolute;
    background-color: #343a40;
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    z-index: 9999;
    font-size: 14px;
    line-height: 1.6;
    pointer-events: none; /* Prevents the tooltip from blocking mouse events */
    white-space: nowrap;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* --- NEW: Drag-to-Create Booking Styles --- */

/* ทำให้ช่องตารางวันมี cursor เป็นรูป crosshair เมื่อเอาเมาส์ไปชี้ */
.grid-day {
    cursor: crosshair;
}

/* สไตล์สำหรับกล่อง selection ที่จะแสดงตอนลากเมาส์ */
#selection-box {
    position: absolute;
    background-color: rgba(13, 110, 253, 0.3); /* สีฟ้าโปร่งแสง */
    border: 1px solid rgba(13, 110, 253, 0.8);
    border-radius: 4px;
    z-index: 100;
    pointer-events: none; /* ทำให้เมาส์ event ทะลุผ่านกล่องนี้ไปได้ */
    display: none; /* ซ่อนไว้ก่อน */
}

/* --- Styles for New Booking Modal --- */
#booking-modal .modal-content {
    max-width: 500px;
}
.modal-static-info {
    font-size: 1rem;
    font-weight: 500;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    margin: 0;
}
#booking-modal .form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}
#booking-modal .form-group {
    flex: 1;
}

/* --- Styles for Movable/Resizable Bookings --- */
.grid-booking {
    cursor: move; /* เปลี่ยน cursor เป็นรูป 'ย้าย' */
    position: relative; /* สำคัญมากสำหรับการใส่ resize handle */
}

.grid-booking .resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    width: 10px;
    height: 100%;
    cursor: ew-resize; /* Cursor สำหรับปรับขนาดแนวนอน */
    z-index: 10;
}
/* --- Styles for Calendar Booking Popup --- */
.popup-hidden {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5);
}
.popup-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 8px;
    position: relative;
}
.popup-content .close-button {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.popup-content form label {
    display: block;
    margin-top: 10px;
    font-weight: bold;
}
.popup-content form input {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    box-sizing: border-box;
}
.popup-content form button[type="submit"] {
    width: 100%;
    padding: 10px;
    margin-top: 20px;
    background-color: #28a745;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
}
/* --- Booking Status Indicators --- */
.grid-booking.paid {
    border-left: 5px solid #28a745; /* Green */
}
.grid-booking.unpaid {
    border-left: 5px solid #dc3545; /* Red */
}
.grid-booking.deposit {
    border-left: 5px solid #ffc107; /* Yellow */
}
/* --- Calendar Action Buttons on Hover --- */
.booking-actions {
    position: absolute;
    top: 4px;
    right: 5px;
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    z-index: 20; /* Add this line */
}

.grid-booking:hover .booking-actions {
    opacity: 1; /* Visible on hover */
}

.action-icon {
    cursor: pointer;
    background-color: rgba(0,0,0,0.4);
    color: white;
    border-radius: 4px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.action-icon:hover {
    background-color: rgba(0,0,0,0.7);
}