/* ==========================================================================
   MAISHA SUITES - BACKOFFICE SYSTEM DESIGN SYSTEM
   Luxury Property Management System (PMS) & Operations Dashboard
   ========================================================================== */

/* 1. VARIABLE SYSTEM */
:root {
    --primary-emerald: #083B2E;      /* Brand Emerald */
    --primary-emerald-hover: #0d4d3d;
    --primary-emerald-dark: #031e17;
    --primary-emerald-light: #f1f6f4;
    
    --accent-gold: #C5A880;          /* Warm Champagne Gold */
    --accent-gold-dark: #a88a62;
    --accent-gold-light: #f7f3ed;
    --accent-gold-raw: #D4AF37;       /* pure logo gold */
    
    --bg-ivory: #FAF8F5;             /* Warm soft background */
    --bg-white: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-contrast: #04211a;          /* Dark section backer */
    
    --text-dark: #1A2E28;            /* Emerald-charcoal */
    --text-muted: #5E716B;           /* Soft sage grey */
    --text-light: #FFFFFF;
    
    --border-color: rgba(8, 59, 46, 0.08);
    --border-color-focus: rgba(197, 168, 128, 0.5);
    
    --shadow-soft: 0 4px 20px rgba(8, 59, 46, 0.02);
    --shadow-hover: 0 10px 30px rgba(8, 59, 46, 0.05);
    --shadow-input: 0 2px 8px rgba(8, 59, 46, 0.02);
    
    --font-serif: "Playfair Display", Georgia, serif;
    --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
    
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-fast: all 0.15s ease-out;

    /* Channel Colors */
    --color-airbnb: #FF5A5F;
    --color-booking: #003580;
    --color-direct: #00A699;
    --color-manual: #5E716B;
}

/* 2. BASE RESET & GLOBAL LAYOUT */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    background-color: var(--bg-ivory);
    color: var(--text-dark);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

/* Main Layout Grid */
.app-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    height: 100vh;
    width: 100vw;
}

/* Typography elements */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 500;
    color: var(--text-dark);
}

p {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(8, 59, 46, 0.1);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(8, 59, 46, 0.2);
}

/* 3. SIDEBAR NAVIGATION */
.sidebar {
    background-color: var(--primary-emerald);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 10;
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 24px;
}

.sidebar-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
    border-radius: 50%;
    border: 1px solid var(--accent-gold);
    padding: 2px;
    background-color: rgba(255, 255, 255, 0.05);
}

.sidebar-brand-name {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.8px;
    color: var(--text-light);
    line-height: 1.2;
}

.sidebar-brand-sub {
    font-family: var(--font-sans);
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 1.5px;
    color: var(--accent-gold);
    text-transform: uppercase;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
}

.sidebar-item {
    width: 100%;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition-fast);
    cursor: pointer;
}

.sidebar-link:hover {
    color: var(--text-light);
    background-color: rgba(255, 255, 255, 0.03);
}

.sidebar-link.active {
    color: var(--text-light);
    font-weight: 600;
    background: linear-gradient(90deg, rgba(197, 168, 128, 0.15) 0%, rgba(197, 168, 128, 0.03) 100%);
    border-left: 3px solid var(--accent-gold);
    padding-left: 11px;
}

.sidebar-link .material-symbols-outlined {
    font-size: 1.25rem;
    color: inherit;
}

.sidebar-link.active .material-symbols-outlined {
    color: var(--accent-gold);
}

/* 4. MAIN VIEWPORT & HEADER */
.main-viewport {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100vh;
}

.top-header {
    height: 70px;
    background-color: rgba(250, 248, 245, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.header-title-section {
    display: flex;
    flex-direction: column;
}

.header-title-section h1 {
    font-size: 1.4rem;
    line-height: 1.2;
}

.header-title-section span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Role Selector Tool */
.role-selector-wrapper {
    background-color: var(--accent-gold-light);
    border: 1px solid rgba(197, 168, 128, 0.4);
    padding: 6px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.role-selector-wrapper span {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-emerald-dark);
}

.role-select {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary-emerald);
    cursor: pointer;
    background: none;
    border: none;
    outline: none;
    padding-right: 4px;
}

.notification-bell {
    position: relative;
    cursor: pointer;
    color: var(--text-dark);
    display: flex;
    align-items: center;
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 6px;
    height: 6px;
    background-color: #E8627D;
    border-radius: 50%;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 1px solid var(--border-color);
    padding-left: 20px;
}

.avatar-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--accent-gold);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-welcome {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* Content Container */
.content-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 32px;
}

/* 5. COMPONENTS & CARDS */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.kpi-card {
    background-color: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    transition: var(--transition-smooth);
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(197, 168, 128, 0.3);
}

.kpi-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-val {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-dark);
    font-family: var(--font-sans);
}

.kpi-trend {
    display: inline-flex;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 600;
    gap: 4px;
}

.kpi-trend.positive {
    color: #2FA882;
}

.kpi-trend.negative {
    color: #E8627D;
}

/* Layout Grid Section Panels */
.panel-grid-2 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.panel-grid-equal {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.dashboard-panel {
    background-color: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    padding: 24px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(8, 59, 46, 0.04);
    padding-bottom: 12px;
}

.panel-title {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* 6. DATA TABLES AND BADGES */
.pms-table-wrapper {
    overflow-x: auto;
    width: 100%;
}

.pms-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.85rem;
}

.pms-table th {
    padding: 12px 16px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.pms-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(8, 59, 46, 0.04);
    color: var(--text-dark);
}

.pms-table tr:hover td {
    background-color: var(--bg-ivory);
}

/* Channel Badge Styles */
.channel-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.channel-badge.airbnb {
    background-color: rgba(255, 90, 95, 0.1);
    color: var(--color-airbnb);
}

.channel-badge.booking {
    background-color: rgba(0, 53, 128, 0.08);
    color: var(--color-booking);
}

.channel-badge.direct {
    background-color: rgba(0, 166, 153, 0.1);
    color: var(--color-direct);
}

.channel-badge.manual {
    background-color: rgba(94, 113, 107, 0.1);
    color: var(--color-manual);
}

/* Status badge styles */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.confirme,
.status-badge.paye,
.status-badge.active {
    background-color: rgba(47, 168, 130, 0.1);
    color: #2FA882;
}

.status-badge.en_cours {
    background-color: rgba(197, 168, 128, 0.15);
    color: var(--accent-gold-dark);
}

.status-badge.a_faire,
.status-badge.en_attente {
    background-color: rgba(212, 175, 55, 0.1);
    color: #A07F00;
}

.status-badge.termine {
    border: 1px solid rgba(47, 168, 130, 0.4);
    color: #1E6C53;
    background-color: transparent;
}

.status-badge.nouveau {
    background-color: rgba(8, 59, 46, 0.05);
    color: var(--primary-emerald);
}

.status-badge.urgente {
    background-color: rgba(232, 98, 125, 0.1);
    color: #E8627D;
}

/* 7. WIDGETS & BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-primary {
    background-color: var(--primary-emerald);
    color: var(--text-light);
    border: 1px solid var(--primary-emerald);
}

.btn-primary:hover {
    background-color: var(--primary-emerald-hover);
    border-color: var(--primary-emerald-hover);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-emerald);
    border: 1px solid var(--primary-emerald);
}

.btn-secondary:hover {
    background-color: var(--primary-emerald-light);
}

.btn-gold {
    background-color: var(--accent-gold);
    color: var(--primary-emerald-dark);
}

.btn-gold:hover {
    background-color: var(--accent-gold-dark);
    color: var(--text-light);
}

/* Tabs Panel Navigation */
.tabs-navigation {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.tab-btn {
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition-fast);
    position: relative;
}

.tab-btn:hover {
    color: var(--text-dark);
}

.tab-btn.active {
    color: var(--primary-emerald);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -9px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-emerald);
    border-radius: 3px 3px 0 0;
}

/* 8. CALENDAR COMPONENT */
.calendar-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 16px;
}

.calendar-filters {
    display: flex;
    align-items: center;
    gap: 12px;
}

.calendar-select {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-white);
    font-size: 0.85rem;
    cursor: pointer;
}

.calendar-grid {
    display: grid;
    grid-template-columns: 180px 1fr;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background-color: var(--bg-white);
    overflow: hidden;
}

.calendar-sidebar-col {
    border-right: 1px solid var(--border-color);
}

.calendar-prop-header {
    height: 50px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-ivory);
}

.calendar-prop-row {
    height: 90px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    border-bottom: 1px solid rgba(8, 59, 46, 0.04);
}

.calendar-prop-thumb {
    width: 46px;
    height: 46px;
    border-radius: 6px;
    object-fit: cover;
}

.calendar-prop-info {
    display: flex;
    flex-direction: column;
}

.calendar-prop-name {
    font-size: 0.85rem;
    font-weight: 600;
}

.calendar-grid-col {
    overflow-x: auto;
    display: flex;
    flex-direction: column;
}

.calendar-days-row {
    display: flex;
    height: 50px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-ivory);
}

.calendar-day-cell {
    min-width: 80px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid rgba(8, 59, 46, 0.04);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.calendar-day-cell.today {
    background-color: var(--accent-gold-light);
    color: var(--primary-emerald);
    font-weight: 700;
}

.calendar-bookings-row {
    display: flex;
    height: 90px;
    position: relative;
    border-bottom: 1px solid rgba(8, 59, 46, 0.04);
    background-image: linear-gradient(to right, rgba(8, 59, 46, 0.02) 1px, transparent 1px);
    background-size: 80px 100%;
}

.calendar-grid-cell-block {
    min-width: 80px;
    height: 100%;
    border-right: 1px solid rgba(8, 59, 46, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: cell;
}

.calendar-grid-cell-block:hover {
    background-color: rgba(197, 168, 128, 0.05);
}

.calendar-grid-cell-block:hover::after {
    content: attr(data-price);
    position: absolute;
    bottom: 4px;
    background-color: var(--primary-emerald);
    color: var(--text-light);
    font-size: 0.65rem;
    padding: 2px 4px;
    border-radius: 4px;
    z-index: 5;
}

.calendar-booking-card {
    position: absolute;
    height: 48px;
    top: 21px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    color: var(--text-light);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    z-index: 2;
    transition: var(--transition-fast);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.calendar-booking-card:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}

.calendar-booking-card.airbnb {
    background-color: var(--color-airbnb);
}

.calendar-booking-card.booking {
    background-color: var(--color-booking);
}

.calendar-booking-card.direct {
    background-color: var(--color-direct);
}

.calendar-booking-card.blocked {
    background-color: var(--color-manual);
    background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255, 255, 255, 0.05) 10px, rgba(255, 255, 255, 0.05) 20px);
}

.calendar-booking-icon {
    font-size: 0.95rem;
    margin-right: 8px;
}

.calendar-legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 50%;
}

/* 9. RESERVATION DETAILS SLIDE-OUT DRAWER */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(8, 59, 46, 0.4);
    backdrop-filter: blur(4px);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-smooth);
}

.drawer-overlay.open {
    opacity: 1;
    visibility: visible;
}

.drawer-content {
    position: absolute;
    top: 0;
    right: -550px;
    width: 500px;
    height: 100%;
    background-color: var(--bg-ivory);
    box-shadow: -10px 0 30px rgba(8, 59, 46, 0.15);
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    z-index: 101;
}

.drawer-overlay.open .drawer-content {
    right: 0;
}

.drawer-header {
    padding: 24px;
    background-color: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.drawer-header-title {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 600;
}

.drawer-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.drawer-section {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
}

.drawer-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.drawer-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
}

.detail-val {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* Actions list */
.actions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-item-btn {
    width: 100%;
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    background-color: var(--bg-white);
    transition: var(--transition-fast);
}

.action-item-btn:hover {
    background-color: var(--primary-emerald-light);
    border-color: var(--primary-emerald);
}

/* Form Styles */
.form-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-white);
    font-family: inherit;
    font-size: 0.85rem;
}

.form-input:focus {
    border-color: var(--accent-gold-dark);
    box-shadow: 0 0 0 3px rgba(197, 168, 128, 0.15);
}

/* 10. GUEST INBOX SCREEN */
.inbox-container {
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    height: calc(100vh - 170px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background-color: var(--bg-white);
    overflow: hidden;
}

.inbox-list-pane {
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.inbox-search-bar {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.chats-list {
    flex-grow: 1;
    overflow-y: auto;
    list-style: none;
}

.chat-list-item {
    padding: 16px;
    border-bottom: 1px solid rgba(8, 59, 46, 0.04);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chat-list-item:hover {
    background-color: var(--bg-ivory);
}

.chat-list-item.active {
    background-color: var(--primary-emerald-light);
    border-left: 3px solid var(--primary-emerald);
    padding-left: 13px;
}

.chat-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-item-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.chat-item-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.chat-item-preview {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inbox-chat-pane {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    overflow: hidden;
}

.chat-pane-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-messages-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.85rem;
    line-height: 1.4;
}

.message-bubble.guest {
    background-color: var(--bg-ivory);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.message-bubble.staff {
    background-color: var(--primary-emerald);
    color: var(--text-light);
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.message-time {
    font-size: 0.65rem;
    margin-top: 4px;
    text-align: right;
    opacity: 0.7;
}

.chat-input-area {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
    background-color: var(--bg-ivory);
}

.chat-actions-row {
    display: flex;
    gap: 8px;
}

.inbox-context-pane {
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 11. FINANCE & CHARTS */
.finance-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.finance-kpi-card {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Custom Charts */
.donut-chart-container {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    height: 200px;
}

.chart-center-label {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chart-center-val {
    font-size: 1.3rem;
    font-weight: 700;
}

.chart-center-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.chart-legend-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
}

.legend-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-bullet {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.legend-right {
    font-weight: 600;
}

/* 12. PROPERTIES & SETTINGS FORM LAYOUTS */
.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.property-card {
    background-color: var(--bg-card);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    transition: var(--transition-smooth);
}

.property-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.property-img {
    height: 180px;
    width: 100%;
    object-fit: cover;
}

.property-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
}

.property-card-title {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 600;
}

.property-meta-row {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.property-amenities-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.amenity-pill {
    background-color: var(--bg-ivory);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(8, 59, 46, 0.4);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-fast);
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background-color: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-hover);
    width: 480px;
    max-width: 90%;
    overflow: hidden;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 600;
}

.modal-close {
    cursor: pointer;
    font-size: 1.4rem;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background-color: var(--bg-ivory);
}

/* Toast Notification Styles */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.toast {
    background-color: var(--primary-emerald);
    color: var(--text-light);
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(8, 59, 46, 0.15);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transform: translateY(20px);
    animation: slideUp 0.3s forwards, fadeOut 0.3s 3s forwards;
}

.toast.error {
    background-color: #E8627D;
}

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

/* ==========================================================================
   RESPONSIVE DESIGN AND MOBILE COMPATIBILITY (Doktaplus-inspired layout)
   ========================================================================== */

/* Menu Hamburger Mobile Button styling */
.mobile-menu-btn {
    display: none;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-dark);
    padding: 6px;
    margin-right: 12px;
    border-radius: 6px;
    transition: var(--transition-fast);
}

.mobile-menu-btn:hover {
    background-color: var(--primary-emerald-light);
}

.mobile-menu-btn .material-symbols-outlined {
    font-size: 1.5rem;
}

/* Sidebar Backdrop styling */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(8, 59, 46, 0.4);
    backdrop-filter: blur(4px);
    z-index: 9;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-smooth);
}

.sidebar-backdrop.open {
    opacity: 1;
    visibility: visible;
}

/* 1. TABLET AND SMALLER VIEWPORTS (< 992px) */
@media (max-width: 992px) {
    /* Collapse main container grid to single column */
    .app-container {
        grid-template-columns: 1fr;
    }

    /* Collapse Sidebar into slide drawer */
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        width: 270px;
        transform: translateX(-100%);
        transition: var(--transition-smooth);
        z-index: 15;
        box-shadow: 10px 0 30px rgba(8, 59, 46, 0.15);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    /* Display mobile menu button */
    .mobile-menu-btn {
        display: flex;
    }

    /* Top bar adjustments */
    .top-header {
        padding: 0 20px;
    }

    .header-title-section span {
        display: none; /* Hide Kinshasa time subtitle on smaller screens */
    }

    /* Stack dashboards side-by-side grids vertically */
    .panel-grid-2, 
    .panel-grid-equal {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Adjust slide-out detail drawers to fill screen width */
    .drawer-content {
        width: 100%;
        max-width: 100%;
        right: -100%;
    }

    .drawer-overlay.open .drawer-content {
        right: 0;
    }

    /* Finance page grid collapsing */
    .finance-stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
}

/* 2. MOBILE VIEWPORTS (< 768px) */
@media (max-width: 768px) {
    .content-body {
        padding: 16px;
    }

    /* Top bar elements layout compression */
    .top-header {
        height: 64px;
        padding: 0 16px;
    }

    .header-title-section h1 {
        font-size: 0.95rem;
    }

    .header-actions {
        gap: 10px;
    }

    /* Compact Role Selector UI */
    .role-selector-wrapper {
        padding: 4px 8px;
    }

    .role-selector-wrapper span {
        display: none; /* Hide label text on mobile */
    }

    .role-select {
        font-size: 0.75rem;
        padding-right: 0;
    }

    /* Avatar and profile text reduction */
    .user-profile {
        padding-left: 10px;
    }

    .user-info {
        display: none; /* Hide "Welcome Admin" text */
    }

    .avatar-img {
        width: 32px;
        height: 32px;
    }

    /* Metrics grids scaling */
    .card-grid {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        gap: 12px;
        margin-bottom: 20px;
    }

    .kpi-card {
        padding: 16px;
        gap: 4px;
    }

    .kpi-val {
        font-size: 1.4rem;
    }

    .kpi-label {
        font-size: 0.65rem;
    }

    /* Tabs wrapping style */
    .tabs-navigation {
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 4px;
        gap: 4px;
    }

    .tab-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    /* Modals fits */
    .modal-container {
        width: 92%;
        margin: 12px;
    }

    .modal-body {
        padding: 16px;
    }

    .modal-footer {
        padding: 12px 16px;
        flex-direction: column-reverse;
        gap: 8px;
    }

    .modal-footer .btn {
        width: 100%;
    }

    /* ==========================================================================
       UNIFIED MESSAGING INBOX - MOBILE SWAPPING
       ========================================================================== */
    .inbox-container {
        grid-template-columns: 1fr;
        height: calc(100vh - 150px);
    }

    /* Default mobile state: show list, hide thread & context */
    .inbox-list-pane {
        display: flex;
        width: 100%;
    }

    .inbox-chat-pane {
        display: none;
        width: 100%;
    }

    .inbox-context-pane {
        display: none !important; /* Hide details panel entirely on mobile */
    }

    /* Active state: hide list, show chat thread */
    .inbox-container.mobile-show-chat .inbox-list-pane {
        display: none;
    }

    .inbox-container.mobile-show-chat .inbox-chat-pane {
        display: flex;
    }

    /* Simulator grids stack */
    .drawer-grid-2 {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    #sim-results {
        grid-template-columns: 1fr;
    }

    /* Property grid */
    .properties-grid {
        grid-template-columns: 1fr;
    }
}

/* Extra small viewports for phone widths */
@media (max-width: 480px) {
    .finance-stats-grid {
        grid-template-columns: 1fr;
    }
}

