/* 
 * Dashboard Styling - Hotel Management System
 * Built with Vanilla CSS for maximum flexibility and rich aesthetics.
 */

:root {
    /* Color Palette */
    --bg-primary: #f8fafc;
    --bg-sidebar: #0f172a;
    --text-primary: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border-color: #e2e8f0;
    
    /* Accents */
    --color-blue: #2563eb;
    --color-blue-light: #dbeafe;
    --color-green: #10b981;
    --color-green-light: #d1fae5;
    --color-orange: #f97316;
    --color-orange-light: #ffedd5;
    --color-red: #ef4444;
    --color-red-light: #fee2e2;
    --color-purple: #8b5cf6;
    --color-purple-light: #ede9fe;
    
    /* Design Tokens */
    --font-main: 'Outfit', sans-serif;
    --border-radius: 12px;
    --sidebar-width: 260px;
    --transition-speed: 0.25s;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -2px rgba(0,0,0,0.05);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Colors Utilities */
.text-blue { color: var(--color-blue); }
.text-green { color: var(--color-green); }
.text-orange { color: var(--color-orange); }
.text-red { color: var(--color-red); }
.text-purple { color: var(--color-purple); }

.blue-bg { background-color: var(--color-blue-light); }
.green-bg { background-color: var(--color-green-light); }
.orange-bg { background-color: var(--color-orange-light); }
.red-bg { background-color: var(--color-red-light); }

.bg-blue { background-color: var(--color-blue); }
.bg-green { background-color: var(--color-green); }
.bg-orange { background-color: var(--color-orange); }
.bg-red { background-color: var(--color-red); }
.bg-purple { background-color: var(--color-purple); }

.font-muted { color: var(--text-muted); }
.font-small { font-size: 0.85rem; }

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

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
}

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

.logo-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-text h2 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #ffffff;
}

.brand-text p {
    font-size: 0.7rem;
    color: var(--text-light);
    font-weight: 300;
    margin-top: 2px;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-light);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.menu-item:hover {
    background-color: rgba(255, 255, 255, 0.04);
    color: #ffffff;
}

.menu-item.active {
    background-color: var(--color-blue);
    color: #ffffff;
}

.menu-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Sidebar Menu Dropdown/Submenus */
.menu-group {
    display: flex;
    flex-direction: column;
}

.menu-dropdown-trigger {
    position: relative;
    padding-right: 36px;
}

.menu-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-speed) ease;
    color: var(--text-light);
}

.menu-group.expanded .menu-arrow {
    transform: translateY(-50%) rotate(180deg);
}

.menu-group.expanded .menu-dropdown-trigger {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.02);
}

.menu-sub-items {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding-left: 20px;
    margin-top: 4px;
}

.menu-group.expanded .menu-sub-items {
    display: flex;
}

.menu-sub-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all var(--transition-speed) ease;
}

.menu-sub-item:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.03);
}

.menu-sub-item.active {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.05);
    font-weight: 600;
}

.sub-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: currentColor;
    opacity: 0.5;
}

.menu-sub-item.active .sub-dot {
    opacity: 1;
    background-color: var(--color-blue);
    box-shadow: 0 0 8px var(--color-blue);
}

/* Sidebar Profile Section */
.sidebar-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 12px;
    background-color: rgba(255, 255, 255, 0.03);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: auto;
    cursor: pointer;
    transition: background var(--transition-speed);
}

.sidebar-profile:hover {
    background-color: rgba(255, 255, 255, 0.06);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--color-blue);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.profile-info {
    flex-grow: 1;
}

.profile-info h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffffff;
}

.profile-info p {
    font-size: 0.75rem;
    color: var(--text-light);
}

.profile-arrow {
    width: 16px;
    height: 16px;
    color: var(--text-light);
}

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    padding: 32px 40px;
    min-height: 100vh;
}

/* Top Header */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.header-title h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.header-title p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 4px;
}

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

/* Custom Dropdown / Selector Controls */
.header-dropdown-btn, .header-dropdown-select {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    position: relative;
    transition: border-color var(--transition-speed);
}

.header-dropdown-btn:hover, .header-dropdown-select:hover {
    border-color: var(--text-light);
}

.dropdown-icon {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.chevron-icon {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
}

.header-dropdown-select select {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    padding-right: 20px;
    cursor: pointer;
    outline: none;
}

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

/* Stat Cards */
.stat-card {
    background-color: #ffffff;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(226, 232, 240, 0.6);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-card-main {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.stat-icon-wrapper {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon {
    width: 24px;
    height: 24px;
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.stat-value-group {
    display: flex;
    flex-direction: column;
}

.stat-primary-val {
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--text-primary);
}

.stat-secondary-val {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.stat-card-footer {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

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

.trend-text.positive {
    color: var(--color-green);
}

.trend-text.negative {
    color: var(--color-red);
}

/* Row 2: Details Grid */
.details-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.details-card {
    background-color: #ffffff;
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(226, 232, 240, 0.6);
}

.card-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.75px;
    margin-bottom: 20px;
    text-transform: uppercase;
}

/* Meal Plans Distribution Card */
.meal-plans-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    height: calc(100% - 30px);
    align-items: center;
}

.meal-plan-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 8px 4px;
}

.meal-plan-item:not(:last-child) {
    border-right: 1px solid var(--border-color);
}

.meal-plan-code {
    font-size: 1.15rem;
    font-weight: 700;
}

.meal-plan-fullname {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
    white-space: nowrap;
}

.meal-plan-guests {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 10px;
    line-height: 1;
}

.meal-plan-unit {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Restaurant Covers Card */
.covers-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: calc(100% - 30px);
}

.cover-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cover-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.sun-icon-bg {
    background-color: #fffbeb;
    color: #d97706;
}

.moon-icon-bg {
    background-color: #e0f2fe;
    color: #0284c7;
}

.cover-icon-wrapper svg {
    width: 22px;
    height: 22px;
}

.cover-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.cover-val {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 4px;
}

/* Target Card */
.target-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: calc(100% - 30px);
}

.target-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.target-icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #d1fae5;
    color: #059669;
    display: flex;
    align-items: center;
    justify-content: center;
}

.target-icon-wrapper svg {
    width: 20px;
    height: 20px;
}

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

.target-small-lbl {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.target-val {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-primary);
}

.target-progress-bar-wrapper {
    height: 6px;
    width: 100%;
    background-color: #f1f5f9;
    border-radius: 100px;
    margin-bottom: 12px;
    overflow: hidden;
}

.target-progress-bar {
    height: 100%;
    background-color: var(--color-green);
    border-radius: 100px;
}

.target-stats-row {
    display: flex;
    justify-content: space-between;
}

.target-stat-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.target-stat-lbl {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.target-stat-val {
    font-size: 0.9rem;
    font-weight: 600;
}

.align-right {
    text-align: right;
}

/* Row 3: Financial Summary */
.financial-summary-card {
    background-color: #ffffff;
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(226, 232, 240, 0.6);
    margin-bottom: 24px;
}

.financials-layout {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.financial-block {
    flex: 1;
}

.financial-main {
    display: flex;
    align-items: center;
    gap: 16px;
}

.financial-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.financial-icon {
    width: 22px;
    height: 22px;
}

.financial-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.financial-lbl {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.financial-val {
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--text-primary);
}

.financial-operator {
    font-size: 1.8rem;
    color: var(--text-light);
    font-weight: 300;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Row 4: Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: 1.1fr 1.1fr 1.8fr;
    gap: 20px;
    margin-bottom: 24px;
}

.chart-card {
    background-color: #ffffff;
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(226, 232, 240, 0.6);
}

.chart-container-donut {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 180px;
}

.canvas-wrapper-donut {
    position: relative;
    width: 130px;
    height: 130px;
    flex-shrink: 0;
}

.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
}

.legend-item {
    display: grid;
    grid-template-columns: 10px 1fr auto;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.legend-name {
    color: var(--text-muted);
    font-weight: 500;
}

.legend-amount {
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
    margin-right: 8px;
}

.legend-pct {
    color: var(--text-muted);
    font-weight: 500;
    text-align: right;
}

.chart-container-line {
    height: 180px;
    position: relative;
    width: 100%;
}

/* Footer Section */
.dashboard-footer {
    display: flex;
    justify-content: center;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    margin-top: 12px;
}

.dashboard-footer p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Responsiveness / Media Queries */
@media (max-width: 1280px) {
    .charts-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .charts-grid > .chart-card:last-child {
        grid-column: span 2;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 16px 24px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    
    .sidebar-brand {
        padding-bottom: 0;
        margin-bottom: 0;
        border-bottom: none;
    }
    
    .sidebar-menu {
        display: none; /* simple hidden navigation for tablets/mobile */
    }
    
    .sidebar-profile {
        margin-top: 0;
        padding: 8px 12px;
    }
    
    .main-content {
        margin-left: 0;
        padding: 24px;
    }
    
    .details-grid {
        grid-template-columns: 1fr;
    }
    
    .financials-layout {
        flex-direction: column;
        gap: 16px;
    }
    
    .financial-operator {
        transform: rotate(90deg);
        padding: 10px 0;
    }
}

@media (max-width: 576px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .charts-grid > .chart-card:last-child {
        grid-column: span 1;
    }
    
    .content-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }
    
    .header-dropdown-btn, .header-dropdown-select {
        justify-content: center;
    }
}
