/* --- SAP Fiori Horizon: Comprehensive Master Stylesheet --- */
:root {
    --sapHeader-bg: #354a5f;
    --sapShell-bg: #edeff0;
    --sapBrand: #0a6ed1;
    --sapHighlight: #0854a0;
    --sapSuccess: #107e3e;
    --sapWarning: #e9730c;
    --sapError: #b00;
    --sapBorder: #d9d9d9;
    --sapContent-text: #32363a;
    --sapLabel-text: #6a6d70;
    --sapCard-shadow: 0 0.125rem 0.5rem 0 rgba(0,0,0,0.05);
}

/* --- 1. Base Reset & Typography --- */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: '72', Arial, sans-serif; 
}

body { 
    background: var(--sapShell-bg); 
    color: var(--sapContent-text); 
    line-height: 1.5; 
}

a { 
    text-decoration: none; 
    color: inherit; 
}

/* --- 2. Shell & Header Structure --- */
.shell { 
    display: flex; 
    flex-direction: column; 
    min-height: 100vh; 
}

.shell-header {
    background: var(--sapHeader-bg);
    color: #fff;
    height: 48px;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.shell-header-logo { 
    font-weight: bold; 
    font-size: 1.1rem; 
    min-width: 180px; 
}

.shell-header-nav { 
    display: flex; 
    height: 100%; 
    flex: 1; 
    justify-content: center; 
}

/* รองรับ Class ทั้งสองแบบที่พบในไฟล์ HTML ของคุณ */
.shell-nav-item, .shell-header-nav-item {
    padding: 0 1.25rem;
    color: #fff;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    height: 100%;
    border-bottom: 4px solid transparent;
    opacity: 0.8;
    transition: all 0.2s ease;
}

.shell-nav-item.active, .shell-header-nav-item.active { 
    opacity: 1; 
    font-weight: bold; 
    border-bottom-color: #fff; 
}

.shell-nav-item:hover, .shell-header-nav-item:hover { 
    background: rgba(255,255,255,0.1); 
    opacity: 1; 
}

/* --- 3. Header Actions (ดีไซน์ตามรูปภาพ) --- */
.shell-header-actions { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    margin-left: auto; 
}

/* ปุ่มเปลี่ยนภาษา EN/TH ขอบมนสีขาว */
.lang-btn {
    background: transparent; 
    color: #fff; 
    border: 1.5px solid #fff;
    padding: 2px 12px; 
    border-radius: 8px; 
    cursor: pointer;
    font-size: 0.85rem; 
    font-weight: bold; 
    height: 28px;
    display: flex; 
    align-items: center; 
    transition: all 0.2s;
}

.lang-btn:hover { 
    background: rgba(255,255,255,0.15); 
}

/* ปุ่มโปรไฟล์พื้นหลังสว่าง ไอคอนสีม่วง */
.profile-btn {
    background: #ebebeb; 
    border: none; 
    width: 32px; 
    height: 32px;
    border-radius: 4px; 
    display: flex; 
    align-items: center;
    justify-content: center; 
    cursor: pointer; 
    padding: 0;
}

.profile-btn .icon { 
    font-size: 1.1rem; 
    color: #5c3b8e; 
}

/* --- 4. Main Layout & Cards --- */
.shell-content { 
    padding: 1.5rem; 
    max-width: 1400px; 
    margin: 0 auto; 
    width: 100%; 
}

.page-header { 
    margin-bottom: 1.5rem; 
}

.page-title { 
    font-size: 1.75rem; 
    font-weight: 300; 
}

.section-title { 
    margin: 2rem 0 1rem 0; 
    font-size: 1.2rem; 
    font-weight: 300; 
}

.card { 
    background: #fff; 
    border: 1px solid var(--sapBorder); 
    border-radius: 0.5rem; 
    padding: 1.25rem; 
    margin-bottom: 1.5rem; 
    box-shadow: var(--sapCard-shadow); 
}

.card-header { 
    margin-bottom: 1rem; 
    border-bottom: 1px solid #eee; 
    padding-bottom: 0.5rem; 
}

.card-title { 
    font-size: 1rem; 
    font-weight: bold; 
}

/* --- 5. Dashboard Grids (KPIs & Tiles) --- */
.kpi-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); 
    gap: 1rem; 
    margin-bottom: 2rem; 
}

/* สไตล์ KPI Card แยกตามสถานะ */
.kpi-card { border-top: 4px solid var(--sapBrand); }
.kpi-card.success { border-top-color: var(--sapSuccess); }
.kpi-card.error { border-top-color: var(--sapError); }
.kpi-card.warning { border-top-color: var(--sapWarning); }

.kpi-value { 
    font-size: 2.8rem; 
    font-weight: 300; 
    margin: 0.5rem 0; 
}

.kpi-label { 
    font-size: 0.85rem; 
    color: var(--sapLabel-text); 
}

.tile-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); 
    gap: 1rem; 
}

a.tile {
    background: #fff; 
    border: 1px solid var(--sapBorder); 
    border-radius: 0.5rem; 
    padding: 1.5rem;
    position: relative; 
    min-height: 120px; 
    display: flex; 
    flex-direction: column;
    border-bottom: 4px solid var(--sapBrand); 
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.tile-icon { 
    position: absolute; 
    right: 1rem; 
    bottom: 1rem; 
    font-size: 2rem; 
    opacity: 0.2; 
}

/* --- 6. Forms & Buttons --- */
.form-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
    gap: 1.5rem; 
}

.form-group { 
    margin-bottom: 1rem; 
    display: flex; 
    flex-direction: column; 
    gap: 0.4rem; 
}

.form-label { 
    font-size: 0.875rem; 
    font-weight: bold; 
    color: var(--sapLabel-text); 
}

.form-input, .form-select, .form-textarea {
    width: 100%; 
    padding: 0.5rem 0.75rem; 
    border: 1px solid var(--sapBorder); 
    border-radius: 4px;
    font-size: 0.875rem; 
    outline: none;
}

.form-input:focus, .form-select:focus { 
    border-color: var(--sapBrand); 
}

.btn { 
    padding: 0 1rem; 
    height: 36px; 
    border-radius: 4px; 
    font-size: 0.875rem; 
    font-weight: 600; 
    cursor: pointer; 
    border: 1px solid var(--sapBorder); 
    background: #fff; 
    transition: all 0.2s;
    display: inline-flex; 
    align-items: center; 
    justify-content: center;
}

.btn-emphasized { 
    background: var(--sapBrand); 
    color: #fff; 
    border-color: var(--sapBrand); 
}

.btn-emphasized:hover { 
    background: var(--sapHighlight); 
}

.btn-danger { 
    color: var(--sapError); 
    border-color: var(--sapError); 
}

.btn-danger:hover { 
    background: var(--sapError); 
    color: #fff; 
}

/* --- 7. Tables & Status Badges --- */
.table { 
    width: 100%; 
    border-collapse: collapse; 
    background: #fff; 
}

.table th { 
    background: #f8f9fa; 
    text-align: left; 
    padding: 0.8rem 1rem; 
    color: var(--sapLabel-text); 
    border-bottom: 2px solid var(--sapBorder); 
    font-size: 0.8rem; 
}

.table td { 
    padding: 1rem; 
    border-bottom: 1px solid #eee; 
    font-size: 0.9rem; 
}

.status-success { 
    color: var(--sapSuccess); 
    border: 1px solid var(--sapSuccess); 
    padding: 2px 10px; 
    border-radius: 12px; 
    background: #e5f3ea; 
    font-size: 0.75rem; 
    font-weight: bold; 
}

.status-warning { 
    color: var(--sapWarning); 
    border: 1px solid var(--sapWarning); 
    padding: 2px 10px; 
    border-radius: 12px; 
    background: #fff4e5; 
    font-size: 0.75rem; 
    font-weight: bold; 
}

.status-error { 
    color: var(--sapError); 
    border: 1px solid var(--sapError); 
    padding: 2px 10px; 
    border-radius: 12px; 
    background: #fbebeb; 
    font-size: 0.75rem; 
    font-weight: bold; 
}

/* --- 8. Calendar System --- */
.calendar-grid { 
    display: grid; 
    grid-template-columns: repeat(7, 1fr); 
    background: var(--sapBorder); 
    gap: 1px; 
    border: 1px solid var(--sapBorder); 
}

.calendar-day-header { 
    background: #f8f9fa; 
    padding: 0.75rem; 
    text-align: center; 
    font-weight: bold; 
    font-size: 0.8rem; 
}

.calendar-day { 
    background: #fff; 
    min-height: 100px; 
    padding: 0.5rem; 
    cursor: pointer; 
    transition: background 0.1s; 
}

.calendar-day:hover { 
    background: #f0f7ff; 
}

.calendar-day-number { 
    font-size: 0.9rem; 
    margin-bottom: 0.5rem; 
}

.calendar-event { 
    font-size: 0.7rem; 
    padding: 2px 4px; 
    background: var(--sapBrand); 
    color: #fff; 
    border-radius: 2px; 
    margin-bottom: 2px; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis;
}

/* --- 9. Room Cards (rooms.html) --- */
.room-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); 
    gap: 1.5rem; 
}

.room-card { 
    border: 1px solid var(--sapBorder); 
    border-radius: 0.5rem; 
    overflow: hidden; 
    display: flex; 
    flex-direction: column; 
    background: #fff; 
}

.room-image { 
    height: 120px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 3rem; 
    color: #fff; 
}

.room-info { 
    padding: 1rem; 
    flex: 1; 
}

.room-name { 
    font-size: 1.1rem; 
    font-weight: bold; 
    margin-bottom: 0.5rem; 
}

.room-meta { 
    font-size: 0.85rem; 
    color: var(--sapLabel-text); 
    margin-bottom: 1rem; 
    line-height: 1.6; 
}

/* --- 10. Reports & Charts --- */
canvas { 
    max-width: 100%; 
    height: auto !important; 
}

/* --- 11. My Bookings Specific --- */
.booking-item { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 1.25rem; 
    border-bottom: 1px solid #eee; 
}

.booking-info h3 { 
    font-size: 1rem; 
    color: var(--sapBrand); 
    margin-bottom: 0.3rem; 
}

.booking-details { 
    font-size: 0.85rem; 
    color: var(--sapLabel-text); 
}

.booking-actions { 
    display: flex; 
    gap: 0.5rem; 
}