* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f8fafc;
    color: #334155;
    line-height: 1.6;
}


/* Layout Container */
.dashboard-container {
    display: grid;
    grid-template-areas:
        "sidebar header"
        "sidebar main";
    grid-template-columns: 280px 1fr;
    grid-template-rows: 70px 1fr;
    min-height: 100vh;
    transition: grid-template-columns 0.3s ease;
}

.dashboard-container.sidebar-collapsed {
    grid-template-columns: 70px 1fr;
}

/* Header */
.header {
    grid-area: header;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--dark-color);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}

.menu-toggle:hover {
    background-color: #f1f5f9;
}

.search-container {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid var(--primary);

    border-radius: 0.5rem;
    background: #f8fafc;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #1e40af;
    background: white;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.notification-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 1.1rem;
    color: #64748b;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}

.notification-btn:hover {
    background-color: #f1f5f9;
}

.notification-badge {
    position: absolute;
    top: 0.3rem;
    right: 0.3rem;
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    padding: 0.1rem 0.3rem;
    border-radius: 50%;
    min-width: 1rem;
    height: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}

.user-profile:hover {
    background-color: #f1f5f9;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--avatar);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #1e293b;
}

.user-role {
    font-size: 0.75rem;
    color: #64748b;
}

/* BUSINESS */
.business-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}

.business-profile:hover {
    background-color: #f1f5f9;
}

.business-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--avatar);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
}

.business-info {
    display: flex;
    flex-direction: column;
}

.business-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #1e293b;
}

.business-role {
    font-size: 0.75rem;
    color: #64748b;
}

/* Sidebar */
.sidebar {
    grid-area: sidebar;
    color: white;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    overflow: hidden;
    background: var(--bg-primary);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo {
    width: 32px;
    height: 32px;
    background: white;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1e40af;
    font-weight: bold;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    white-space: nowrap;
    transition: opacity 0.3s ease;
}

.sidebar-collapsed .logo-text {
    opacity: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
    max-height: calc(100vh - 72px);
}
/* Width and color of the scrollbar */
::-webkit-scrollbar {
  width: 10px;      /* vertical scrollbar */
  height: 10px;     /* horizontal scrollbar */
}

/* Track (the background area) */
::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

/* Handle (the draggable part) */
::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 10px;
}

/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
  background: var(--bg-secondary);
}

.nav-section {
    margin-bottom: 2rem;
}

.nav-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.7);
    padding: 0 1.5rem;
    margin-bottom: 0.5rem;
    transition: opacity 0.3s ease;
}

.sidebar-collapsed .nav-section-title {
    opacity: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.2s;
    position: relative;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: white;
}

.nav-subitem {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.2s;
    position: relative;
}

.nav-subitem.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-subitem.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: white;
}

.nav-item i {
    width: 20px;
    margin-right: 0.75rem;
    text-align: center;
}

.nav-item-text {
    white-space: nowrap;
    transition: opacity 0.3s ease;
    text-transform: uppercase;
}

.sidebar-collapsed .nav-item-text {
    opacity: 0;
}

/* Main Content */
.main-content {
    grid-area: main;
    padding: 2rem;
    overflow-y: auto;
}

.page-header {
    margin-bottom: 1rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    /*text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);*/
    /* x-offset, y-offset, blur-radius, color */
}

.page-subtitle {
    color: #64748b;
    font-size: 1rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.stat-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.stat-icon.blue {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.stat-icon.green {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.stat-icon.purple {
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
}

.stat-icon.orange {
    background: rgba(249, 115, 22, 0.1);
    color: #f97316;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.stat-change {
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-change.positive {
    color: #22c55e;
}

.stat-change.negative {
    color: #ef4444;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #1e40af;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

/* Chart Container */
.chart-container {
    height: 300px;
    position: relative;
}

/* Recent Activity */
.activity-list {
    list-style: none;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.activity-time {
    font-size: 0.75rem;
    color: #64748b;
}

.business-title {
    white-space: nowrap;
    /* Prevents wrapping to the next line */
    overflow: hidden;
    /* Hides overflowing text */
    text-overflow: ellipsis;
    /* Adds "..." at the end */
}

/* Responsive Design */
@media (max-width: 1024px) {
    .business-title {
        display: block;
        width: 10rem;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .user-info {
        display: none;
    }



    .mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 15;
    }

    .mobile-overlay.active {
        display: block;
    }

    .main-content {
        padding: 1rem;
    }



}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 280px;
        z-index: 20;
        transition: left 0.3s ease;
    }

    .sidebar.mobile-open {
        left: 0;
    }

    .dashboard-container {
        grid-template-areas:
            "header"
            "main";
        grid-template-columns: 1fr;
        grid-template-rows: 70px 1fr;
    }

}

@media (max-width: 480px) {
    .header {
        padding: 0 1rem;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .card {
        padding: 1rem;
    }
}

/* Submenu */
.submenu {
    display: none;
    flex-direction: column;
}

.submenu a {
    padding: 0.5rem 1.5rem 0.5rem 4.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.2s;
}

.submenu a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05)
}

.has-submenu {
    display: flex;
    justify-content: space-between;
    cursor: pointer;
    align-items: center;
}

.toggle-icon {
    font-size: 0.8rem;
    margin-left: auto;
    transition: transform 0.3s;
}

.has-submenu.active .toggle-icon {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    top: 80px;
    /* Adjust based on header height */
    right: 2rem;
    background: white;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    display: none;
    flex-direction: column;
    min-width: 230px;
    z-index: 50;
    padding: 0.5rem;

}

.business-dropdown {
    position: absolute;
    top: 80px;
    /* Adjust based on header height */
    right: 2rem;
    background: white;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    display: none;
    flex-direction: column;
    min-width: 230px;
    z-index: 50;
    padding: 0.5rem;

}

.dropdown-item {
    padding: 0.75rem 1rem;
    color: #334155;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: #f1f5f9;
    color: var(--bg-secondary);
}