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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1f2937;
    background-color: #f8fafc;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

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

/* Sidebar */
.sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
}

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

.logo span {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
}

.restaurant-info h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.restaurant-info p {
    font-size: 14px;
    color: #6b7280;
}

.sidebar-nav {
    flex: 1;
    padding: 24px 0;
}

.sidebar-nav ul {
    list-style: none;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    color: #6b7280;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    border-right: 3px solid transparent;
    min-height: 44px;
}

.nav-item:hover {
    background: #f9fafb;
    color: #1f2937;
}

.nav-item.active {
    background: #f0fdf4;
    color: rgb(0, 100, 0);
    border-right-color: rgb(0, 100, 0);
}

.sidebar-footer {
    padding: 24px;
    border-top: 1px solid #e5e7eb;
}

.demo-badge {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    background: #f8fafc;
}

.dashboard-header {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 24px 32px;
}

.header-content {
    width: 100%;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    position: relative;
}

.page-title h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 4px;
}

.page-title p {
    color: #6b7280;
    font-size: 16px;
}

.header-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    min-width: 300px;
}

.header-buttons {
    display: flex;
    gap: 12px;
    width: 100%;
}

.restaurant-btn {
    flex: 1;
    background: linear-gradient(135deg, rgb(0, 100, 0) 0%, rgb(0, 120, 0) 100%);
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 100, 0, 0.2);
}

.restaurant-btn:hover {
    background: linear-gradient(135deg, rgb(0, 80, 0) 0%, rgb(0, 100, 0) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 100, 0, 0.3);
}

.date-range select {
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    color: #374151;
    font-size: 14px;
    min-height: 44px;
}

.refresh-btn {
    flex: 1;
    background: rgb(0, 100, 0);
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(0, 100, 0, 0.2);
}

.refresh-btn:hover {
    background: rgb(0, 80, 0);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 100, 0, 0.3);
}

/* Dashboard Grid */
.dashboard-grid {
    padding: 32px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    grid-template-areas:
        "metrics metrics"
        "charts charts"
        "timeline popular"
        "customer notifications";
}

/* Metrics Overview */
.metrics-overview {
    grid-area: metrics;
}

.metric-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.metric-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgb(0, 100, 0);
}

.metric-card.revenue::before { background: #059669; }
.metric-card.orders::before { background: #3b82f6; }
.metric-card.customers::before { background: #8b5cf6; }
.metric-card.average::before { background: #f59e0b; }

.metric-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.metric-content h3 {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 8px;
    font-weight: 500;
}

.metric-value {
    font-size: 32px;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 8px;
}

.metric-change {
    font-size: 14px;
    font-weight: 500;
}

.metric-change.positive {
    color: #059669;
}

.metric-change.negative {
    color: #dc2626;
}

/* Charts Section */
.charts-section {
    grid-area: charts;
}

.chart-container {
    background: white;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e5e7eb;
}

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

.chart-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
}

.chart-tabs {
    display: flex;
    gap: 8px;
}

.chart-tab {
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    background: white;
    color: #6b7280;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-tab.active {
    background: rgb(0, 100, 0);
    color: white;
    border-color: rgb(0, 100, 0);
}

.chart-content {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    border-radius: 8px;
    position: relative;
}

#revenue-chart {
    width: 100%;
    height: 100%;
}

/* Orders Timeline */
.orders-timeline {
    grid-area: timeline;
    background: white;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e5e7eb;
}

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

.timeline-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.live-indicator {
    font-size: 12px;
    background: #fee2e2;
    color: #dc2626;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.timeline-content {
    max-height: 400px;
    overflow-y: auto;
}

.order-item {
    display: grid;
    grid-template-columns: 80px 1fr auto auto;
    gap: 12px;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #f3f4f6;
}

.order-item:last-child {
    border-bottom: none;
}

.order-time {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

.order-details strong {
    font-size: 14px;
    color: #1f2937;
}

.order-items {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

.order-amount {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.order-status {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.order-status.pickup {
    background: #f0fdf4;
    color: #166534;
}

.order-status.delivery {
    background: #eff6ff;
    color: #1d4ed8;
}

/* Popular Items */
.popular-items {
    grid-area: popular;
    background: white;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e5e7eb;
}

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

.section-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.period-label {
    font-size: 12px;
    color: #6b7280;
    background: #f3f4f6;
    padding: 4px 8px;
    border-radius: 12px;
}

.items-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.item-rank {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rank-number {
    width: 24px;
    height: 24px;
    background: rgb(0, 100, 0);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.item-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.item-image {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}

.item-details strong {
    font-size: 14px;
    color: #1f2937;
}

.item-stats {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

.item-chart {
    width: 40px;
    height: 20px;
    position: relative;
}

.mini-bar {
    background: linear-gradient(135deg, rgb(0, 100, 0) 0%, rgb(0, 120, 0) 100%);
    border-radius: 2px;
    width: 100%;
    transition: height 0.3s;
}

/* Customer Analytics */
.customer-analytics {
    grid-area: customer;
    background: white;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e5e7eb;
}

.customer-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.customer-metric {
    text-align: center;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
}

.metric-label {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

.metric-number {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 4px;
}

.metric-subtext {
    font-size: 11px;
    color: #6b7280;
}

.order-type-chart h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 16px;
}

.pie-chart {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: conic-gradient(
        rgb(0, 100, 0) 0% 65%,
        #3b82f6 65% 100%
    );
}

.pie-chart::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 50%;
}

.pie-legend {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

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

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.legend-color.pickup {
    background: rgb(0, 100, 0);
}

.legend-color.delivery {
    background: #3b82f6;
}

/* Notifications */
.notifications-panel {
    grid-area: notifications;
    background: white;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e5e7eb;
}

.mark-read {
    font-size: 12px;
    color: rgb(0, 100, 0);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
    padding: 8px;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.notifications-list {
    max-height: 300px;
    overflow-y: auto;
}

.notification {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.notification.new {
    background: #f0fdf4;
    border-left: 3px solid rgb(0, 100, 0);
}

.notification:hover {
    background: #f9fafb;
}

.notification-icon {
    font-size: 16px;
    margin-top: 2px;
}

.notification-content strong {
    font-size: 14px;
    color: #1f2937;
}

.notification-details {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

.notification-time {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
}

/* Responsive Design - Mobile First Approach */
@media (max-width: 480px) {
    .mobile-menu-btn {
        display: flex;
    }
    
    .sidebar {
        width: 100%;
        max-width: 320px;
    }
    
    .dashboard-header {
        padding: 12px 16px;
    }
    
    .page-title h1 {
        font-size: 24px;
    }
    
    .page-title p {
        font-size: 14px;
    }
    
    .page-title {
        text-align: center;
    }
    
    .header-top {
        flex-direction: column;
        align-items: center;
        gap: 16px;
        padding-right: 50px;
    }
    
    .header-controls {
        align-items: center !important;
        min-width: auto !important;
        width: 100% !important;
    }
    
    .date-range {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
    }
    
    .date-range select {
        max-width: 200px !important;
        text-align: center !important;
    }
    
    .header-buttons {
        gap: 8px;
        width: 100%;
    }
    
    .restaurant-btn,
    .refresh-btn {
        font-size: 13px;
        padding: 12px 8px;
    }
    
    .dashboard-grid {
        padding: 16px;
        gap: 16px;
    }
    
    .metric-cards {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .metric-card {
        padding: 16px;
    }
    
    .metric-value {
        font-size: 24px;
    }
    
    .metric-icon {
        font-size: 24px;
        margin-bottom: 8px;
    }
    
    .chart-container {
        padding: 16px;
    }
    
    .chart-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .chart-tabs {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 4px;
    }
    
    .chart-tab {
        font-size: 12px;
        padding: 10px 8px;
    }
    
    .chart-content {
        height: 250px;
    }
    
    .timeline-content,
    .notifications-list {
        max-height: 250px;
    }
    
    .order-item {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 12px 0;
        text-align: left;
    }
    
    .order-time {
        font-weight: 600;
        color: #1f2937;
    }
    
    .order-amount {
        font-size: 18px;
        color: rgb(0, 100, 0);
    }
    
    .order-status {
        align-self: start;
        margin-top: 4px;
    }
    
    .customer-metrics {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .customer-metric {
        padding: 12px;
    }
    
    .metric-number {
        font-size: 20px;
    }
    
    .pie-chart {
        width: 100px;
        height: 100px;
    }
    
    .pie-chart::after {
        width: 50px;
        height: 50px;
    }
    
    .pie-legend {
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }
    
    .notification {
        flex-direction: column;
        gap: 8px;
        padding: 16px;
    }
    
    .notification-icon {
        font-size: 20px;
        align-self: flex-start;
    }
    
    .items-list {
        gap: 12px;
    }
    
    .item-rank {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px;
        background: #f9fafb;
        border-radius: 8px;
    }
    
    .rank-number {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .item-info {
        width: 100%;
    }
    
    .item-image {
        width: 48px;
        height: 48px;
    }
    
    .item-chart {
        width: 100%;
        height: 8px;
        margin-top: 8px;
    }
}

@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "metrics"
            "charts"
            "timeline"
            "popular"
            "customer"
            "notifications";
    }
    
    .metric-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
        width: 300px;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .metric-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .dashboard-header {
        padding: 16px 20px;
    }
    
    .dashboard-grid {
        padding: 20px;
        gap: 16px;
    }
    
    .page-title {
        text-align: center;
    }
    
    .header-top {
        flex-direction: column;
        align-items: center;
        gap: 16px;
        padding-right: 50px;
    }
    
    .header-controls {
        align-items: center !important;
        min-width: auto !important;
        width: 100% !important;
    }
    
    .date-range {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
    }
    
    .date-range select {
        max-width: 250px !important;
        text-align: center !important;
    }
    
    .header-buttons {
        gap: 10px;
        width: 100%;
    }
    
    .restaurant-btn,
    .refresh-btn {
        font-size: 14px;
        padding: 12px 16px;
    }
    
    .page-title h1 {
        font-size: 26px;
    }
    
    .chart-header {
        flex-direction: row;
    }
    
    .chart-tabs {
        display: flex;
        gap: 8px;
    }
    
    .chart-tab {
        font-size: 13px;
        padding: 10px 12px;
    }
    
    .order-item {
        grid-template-columns: auto 1fr auto auto;
        gap: 12px;
        align-items: center;
    }
    
    .customer-metrics {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .notification {
        flex-direction: row;
        padding: 12px;
    }
    
    .item-rank {
        flex-direction: row;
        align-items: center;
        padding: 0;
        background: none;
    }
    
    .item-chart {
        width: 40px;
        height: 20px;
        margin-top: 0;
    }
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    animation: pulse 2s infinite;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    position: absolute;
    top: 0;
    right: 0;
}

.hamburger-line {
    display: block;
    height: 3px;
    width: 100%;
    background-color: #1f2937;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 200;
}

.mobile-menu-overlay.active {
    display: block;
}

.sidebar.mobile-active {
    transform: translateX(0);
    z-index: 300;
}