:root {
    /* Colors */
    --navy-blue: #0B1936;
    --navy-light: #162a56;
    --navy-active: #1d366a;
    --canvas-bg: #F3F4F6;
    --card-bg: #FFFFFF;
    
    /* Text */
    --text-main: #111827;
    --text-muted: #6B7280;
    --text-sidebar: #D1D5DB;
    --text-sidebar-heading: #9CA3AF;
    --text-sidebar-active: #FFFFFF;
    
    /* Status Colors */
    --vacant: #10B981; /* Emerald */
    --vacant-bg: #ECFDF5;
    --occupied: #3B82F6; /* Blue */
    --occupied-bg: #EFF6FF;
    --reserved: #F59E0B; /* Amber */
    --reserved-bg: #FFFBEB;
    --housekeeping: #6B7280; /* Gray */
    --housekeeping-bg: #F3F4F6;
    --maintenance: #EF4444; /* Red */
    --maintenance-bg: #FEF2F2;

    --border-color: #E5E7EB;
    --border-radius: 8px;
    
    /* Metrics */
    --sidebar-width: 260px;
    --sidebar-width-icon: 56px;
    --spacing: .25rem;

    /* Fonts */
    --font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

html {
    /* line-height: 1.5; */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Custom Scrollbar Styles */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(107, 114, 128, 0.3);
    border-radius: 9999px;
    transition: background-color 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(107, 114, 128, 0.5);
}

body {
    font-family: var(--font-sans);
    background-color: var(--canvas-bg);
    color: var(--text-main);
    overflow: hidden; /* App-like full height */
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
}

.sidebar {
    display: flex !important;
    transition: width 0.2s ease-linear;
}

.sidebar.collapsed {
    width: var(--sidebar-width-icon) !important;
}

.spacer-container {
    width: var(--sidebar-width);
    transition: width 0.2s ease-linear;
}

.fixed-sidebar-container {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    height: 100vh !important;
    width: var(--sidebar-width);
    transition: width 0.2s ease-linear;
    background-color: #05193a !important;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 40;
}

.sidebar.collapsed .spacer-container {
    width: var(--sidebar-width-icon) !important;
}

.sidebar.collapsed .fixed-sidebar-container {
    width: var(--sidebar-width-icon) !important;
}

/* Collapsed layout overrides for header, groups, menu-buttons, and footer */
.sidebar.collapsed [data-sidebar="header"] .flex-col {
    display: none !important;
}

.sidebar.collapsed [data-sidebar="header"] .flex {
    justify-content: center !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    gap: 0 !important;
}

.sidebar.collapsed [data-sidebar="group-label"] {
    display: none !important;
}

.sidebar.collapsed [data-sidebar="menu-button"] span {
    display: none !important;
}

.sidebar.collapsed [data-sidebar="menu-button"] .lock-icon {
    display: none !important;
}

.sidebar.collapsed [data-sidebar="menu-button"] {
    justify-content: center !important;
    padding: 0 !important;
    width: 36px !important;
    height: 36px !important;
    margin: 0 auto !important;
}

.sidebar.collapsed [data-sidebar="footer"] {
    display: none !important;
}

/* Mobile drawer responsiveness */
@media (max-width: 767.98px) {
    .sidebar {
        display: block !important;
        width: 0 !important;
        position: relative;
    }

    .sidebar .spacer-container {
        display: none !important;
    }

    .sidebar .fixed-sidebar-container {
        display: flex !important;
        position: fixed;
        top: 0;
        left: -100%;
        width: 260px !important;
        height: 100vh;
        z-index: 1050;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 10px 0 25px -5px rgba(0, 0, 0, 0.3);
    }

    .sidebar.mobile-active .fixed-sidebar-container {
        left: 0 !important;
    }

    /* Backdrop overlay effect when drawer is active */
    .sidebar::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 1040;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .sidebar.mobile-active::before {
        opacity: 1;
        pointer-events: auto;
    }
}

/* Shadcn UI Sidebar Compatibility layer */
.bg-sidebar {
    background-color: #05193a !important;
}

.border-sidebar-border {
    border-color: #1b2e4c !important;
}

.bg-sidebar-primary {
    background-color: #1777b8 !important;
}

.text-sidebar-primary-foreground {
    color: #f7fbfd !important;
}

.text-sidebar-foreground {
    color: #dce6ee !important;
}

.text-sidebar-foreground\/60 {
    color: rgba(220, 230, 238, 0.6) !important;
}

.text-sidebar-foreground\/50 {
    color: rgba(220, 230, 238, 0.5) !important;
}

.text-sidebar-foreground\/70 {
    color: rgba(220, 230, 238, 0.7) !important;
}

/* Utility class fallback definitions */
.sidebar .flex {
    display: flex;
}
.sidebar .flex-col {
    flex-direction: column;
}
.sidebar .items-center {
    align-items: center;
}
.sidebar .justify-center {
    justify-content: center;
}
.sidebar .gap-1 {
    gap: 4px;
}
.sidebar .gap-2 {
    gap: 8px;
}
.sidebar .p-2 {
    padding: 8px;
}
.sidebar .px-2 {
    padding-left: 8px;
    padding-right: 8px;
}
.sidebar .py-1 {
    padding-top: 4px;
    padding-bottom: 4px;
}
.sidebar .py-2 {
    padding-top: 8px;
    padding-bottom: 8px;
}
.sidebar .h-8 {
    height: 32px;
}
.sidebar .w-8 {
    width: 32px;
}
.w-4 {
    width: calc(var(--spacing) * 4);
}
.h-4 {
    height: calc(var(--spacing) * 4);
}
.sidebar .w-4 {
    width: calc(var(--spacing) * 4);
}
.sidebar .h-4 {
    height: calc(var(--spacing) * 4);
}
.sidebar .shrink-0 {
    flex-shrink: 0;
}
.sidebar .rounded-md {
    border-radius: 6px;
}
.sidebar .truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar .text-sm {
    font-size: 14px;
}
.sidebar .font-semibold {
    font-weight: 600;
}
.sidebar .text-xs {
    font-size: 12px;
}
.sidebar .font-medium {
    font-weight: 500;
}
.sidebar .text-\[10px\] {
    font-size: 10px;
}
.sidebar .uppercase {
    text-transform: uppercase;
}
.sidebar .tracking-wider {
    letter-spacing: 0.05em;
}
.sidebar .w-full {
    width: 100%;
}
.sidebar .min-w-0 {
    min-width: 0;
}
.sidebar .h-full {
    height: 100%;
}

/* Data-sidebar specific layout styling */
[data-sidebar="sidebar"] {
    display: flex;
    height: 100%;
    width: 100%;
    flex-direction: column;
    background-color: #05193a;
}

[data-sidebar="header"] {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

[data-sidebar="content"] {
    display: flex;
    min-height: 0;
    flex: 1;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    padding: 8px;
    padding-left: 0;
    padding-top: 0px;
}

[data-sidebar="group"] {
    position: relative;
    display: flex;
    width: 100%;
    min-width: 0;
    flex-direction: column;
    padding: 8px 4px;
}

[data-sidebar="group-label"] {
    display: flex;
    height: 28px;
    align-items: center;
    border-radius: 6px;
    padding-left: 8px;
    padding-right: 8px;
    font-size: 11px;
    font-weight: 600;
    color: #6c7e9a;
    outline: none;
    text-transform: none;
    /* letter-spacing: 0.5px; */
}

[data-sidebar="group-content"] {
    width: 100%;
}

[data-sidebar="menu"] {
    display: flex;
    width: 100%;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 0;
}

[data-sidebar="menu-item"] {
    position: relative;
    list-style: none;
}

[data-sidebar="menu-button"] {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 12px;
    overflow: hidden;
    border-radius: 6px;
    padding: 8px 12px;
    text-align: left;
    outline: none;
    text-decoration: none;
    font-size: 13.5px;
    color: #cbd5e1;
    transition: all 0.2s ease;
    cursor: pointer;
    height: 36px;
    box-sizing: border-box;
}

[data-sidebar="menu-button"] svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

[data-sidebar="menu-button"]:hover,
[data-sidebar="menu-button"].hover {
    background-color: #162d53 !important;
    color: #f7fbfd !important;
}

[data-sidebar="menu-button"][data-active="true"],
[data-sidebar="menu-button"].active {
    background-color: #162d53 !important;
    color: #f7fbfd !important;
    font-weight: 600;
}

[data-sidebar="footer"] {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    border-top: 1px solid #1b2e4c;
}

.version {
    font-size: 11px;
    color: #6c7e9a;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.top-header {
    height: 60px;
    background: transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 32px;
}

.toggle-sidebar {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
}

.toggle-sidebar:hover {
    color: var(--text-main);
}

.date {
    font-size: 14px;
    color: var(--text-muted);
}

.dashboard-content {
    padding: 0 32px 32px 32px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    position: relative;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.page-header p {
    font-size: 14px;
    color: var(--text-muted);
}

.btn {
    padding: 10px 16px;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--navy-blue);
    color: white;
}

.btn-primary:hover {
    background-color: var(--navy-active);
}

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

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

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.stat-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.bg-blue {
    background-color: var(--occupied-bg);
    color: var(--occupied);
}

.stat-icon i {
    width: 16px;
    height: 16px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.stat-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

/* Charts Area */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.chart-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.card-header i {
    width: 18px;
    height: 18px;
    color: var(--text-main);
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
}

.chart-body {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Floor Grid */
.floor-grid-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
}

.floor-group {
    margin-bottom: 20px;
}

.floor-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.room-count {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

.room-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 640px) {
    .room-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (min-width: 768px) {
    .room-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
@media (min-width: 1024px) {
    .room-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

.room-card {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.room-number {
    font-weight: 600;
    font-size: 15px;
}

.room-type {
    font-size: 12px;
    color: var(--text-muted);
}

.room-price {
    font-size: 13px;
    font-weight: 500;
}

.room-status {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.status-vacant { background: var(--vacant-bg); color: var(--vacant); }
.status-occupied { background: var(--occupied-bg); color: var(--occupied); }
.status-reserved { background: var(--reserved-bg); color: var(--reserved); }
.status-housekeeping { background: var(--housekeeping-bg); color: var(--housekeeping); }
.status-maintenance { background: var(--maintenance-bg); color: var(--maintenance); }

/* Dashboard Room Card Premium Hover Styling */
.dashboard-room-card {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
}

.dashboard-room-card.status-card-vacant { background: rgba(16, 185, 129, 0.04); }
.dashboard-room-card.status-card-occupied { background: rgba(14, 165, 233, 0.04); }
.dashboard-room-card.status-card-reserved { background: rgba(245, 158, 11, 0.04); }
.dashboard-room-card.status-card-housekeeping { background: rgba(107, 114, 128, 0.04); }
.dashboard-room-card.status-card-maintenance { background: rgba(239, 68, 68, 0.04); }


.dashboard-room-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 20px -8px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    border-color: #CBD5E1;
}

.dashboard-room-card.is-active {
    border-color: var(--navy-active) !important;
    box-shadow: 0 0 0 2px var(--occupied-bg) !important;
}

.dashboard-room-card .room-stripe {
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dashboard-room-card:hover .room-stripe {
    width: 6px;
}

/* Premium Room Details Tooltip Popup */
.room-details-tooltip {
    position: absolute;
    z-index: 100;
    width: 300px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(0, 0, 0, 0.02);
    padding: 16px;
    font-size: 13px;
    color: var(--text-main);
    opacity: 0;
    transform: scale(0.95) translateY(5px);
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.2s;
    pointer-events: auto;
    visibility: hidden;
}

.room-details-tooltip.show {
    visibility: visible;
    opacity: 1;
    transform: scale(1) translateY(0);
}

.tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.tooltip-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--navy-blue);
    display: flex;
    align-items: center;
    gap: 6px;
}

.tooltip-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.tooltip-close:hover {
    background: #F1F5F9;
    color: var(--text-main);
}

.tooltip-section {
    margin-bottom: 12px;
}

.tooltip-section:last-child {
    margin-bottom: 0;
}

.tooltip-section-title {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 2px;
}

.tooltip-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 12px;
}

.tooltip-item {
    display: flex;
    flex-direction: column;
}

.tooltip-label {
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 1px;
}

.tooltip-value {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-main);
}

.tooltip-value-highlight {
    font-size: 12px;
    font-weight: 600;
    color: var(--navy-blue);
}

.tooltip-arrow {
    position: absolute;
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.98);
    border-left: 1px solid rgba(226, 232, 240, 0.9);
    border-top: 1px solid rgba(226, 232, 240, 0.9);
    z-index: -1;
}

/* Tooltip Arrow Positions */
.room-details-tooltip[data-popper-placement^='top'] > .tooltip-arrow {
    bottom: -6px;
    border-left: none;
    border-top: none;
    border-right: 1px solid rgba(226, 232, 240, 0.9);
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    transform: rotate(45deg);
}

.room-details-tooltip[data-popper-placement^='bottom'] > .tooltip-arrow {
    top: -6px;
    border-right: none;
    border-bottom: none;
    border-left: 1px solid rgba(226, 232, 240, 0.9);
    border-top: 1px solid rgba(226, 232, 240, 0.9);
    transform: rotate(45deg);
}

.room-details-tooltip[data-popper-placement^='left'] > .tooltip-arrow {
    right: -6px;
    border-top: none;
    border-left: none;
    border-right: 1px solid rgba(226, 232, 240, 0.9);
    border-top: 1px solid rgba(226, 232, 240, 0.9);
    transform: rotate(45deg);
}

.room-details-tooltip[data-popper-placement^='right'] > .tooltip-arrow {
    left: -6px;
    border-bottom: none;
    border-right: none;
    border-left: 1px solid rgba(226, 232, 240, 0.9);
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    transform: rotate(45deg);
}


/* Lovable Badge */
.lovable-badge {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #111827;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    z-index: 1000;
}

.lovable-badge button {
    background: none;
    border: none;
    color: #9CA3AF;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    padding: 0 0 0 4px;
}

.lovable-badge button:hover {
    color: white;
}

/* Tooltip Actions Styling */
.tooltip-actions {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--border-color);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.tooltip-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.tooltip-btn-primary {
    background-color: var(--primary-color, #4F46E5);
    color: #ffffff !important;
}

.tooltip-btn-primary:hover {
    background-color: var(--primary-color-hover, #4338CA);
    transform: translateY(-1px);
}

.tooltip-btn-secondary {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-muted) !important;
    border: 1px solid var(--border-color);
}

.tooltip-btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-color) !important;
    transform: translateY(-1px);
}
