#loadingIndicator {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(255, 255, 255, 0.8);
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

#loadingIndicator .spinner {
  border: 4px solid var(--border-color);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

#errorDisplay .alert {
  margin: 20px;
  padding: 15px;
  border-radius: 5px;
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Skeleton Loader Styles */
#skeleton-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f0f2f5; /* Light background for the loader */
    z-index: 9999; /* Ensure it's on top of everything */
    display: flex;
    box-sizing: border-box;
    overflow: hidden; /* Hide overflow from shimmer effect */
}

#skeleton-loader .skeleton-sidebar {
    width: 250px; /* Match actual sidebar width */
    height: 100%;
    background-color: #2c2c2c; /* Match actual sidebar background */
    position: relative;
    overflow: hidden;
    padding: 20px 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.skeleton-logo {
    width: 80%;
    height: 40px;
    background-color: #444;
    border-radius: 4px;
    margin-bottom: 20px;
}

.skeleton-profile {
    width: 80%;
    height: 100px;
    background-color: #444;
    border-radius: 8px;
    margin-bottom: 20px;
}

.skeleton-menu-section {
    width: 80%;
    height: 120px;
    background-color: #444;
    border-radius: 8px;
    margin-bottom: 10px;
}

#skeleton-loader .skeleton-main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    box-sizing: border-box;
}

#skeleton-loader .skeleton-header {
    height: 80px; /* Match actual header height */
    background-color: #d9534f; /* Match actual header background */
    border-radius: 8px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.skeleton-stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.skeleton-stat-card {
    background-color: #e0e2e5;
    border-radius: 8px;
    box-shadow: 0 4px 8px 0 #d47272;
    position: relative;
    overflow: hidden;
}

.skeleton-table-section {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex-grow: 1;
}

.skeleton-section-header {
    height: 30px;
    width: 60%;
    background-color: #e0e2e5;
    border-radius: 4px;
}

.skeleton-table-filter-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.skeleton-search-input {
    height: 38px;
    width: 250px;
    background-color: #e0e2e5;
    border-radius: 4px;
}

.skeleton-filter-buttons {
    display: flex;
    gap: 5px;
}

.skeleton-filter-buttons > div {
    height: 38px;
    width: 80px;
    background-color: #e0e2e5;
    border-radius: 4px;
}

.skeleton-add-button {
    height: 38px;
    width: 180px;
    background-color: #d9534f;
    border-radius: 4px;
    margin-left: auto;
}

.skeleton-table {
    width: 100%;
    border-collapse: collapse;
}

.skeleton-table-row {
    height: 40px;
    background-color: transparent; /* The row itself is just a container */
    border-radius: 4px;
    margin-bottom: 8px;
    position: relative;
    overflow: hidden;
    display: flex;
    gap: 8px; /* Space between cells */
}

.skeleton-cell {
    height: 100%;
    background-color: #e0e2e5;
    border-radius: 4px;
}

.skeleton-table-row.header {
    background-color: #d9534f;
    height: 50px;
    margin-bottom: 10px;
}

.skeleton-pagination {
    height: 30px;
    width: 200px;
    background-color: #e0e2e5;
    border-radius: 4px;
    align-self: center;
    margin-top: 10px;
}

/* Shimmer Effect */
#skeleton-loader div::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

/* Responsive adjustments for skeleton loader */
@media (max-width: 768px) {
    #skeleton-loader {
        flex-direction: column;
        padding: 10px;
    }

    #skeleton-loader .skeleton-sidebar {
        width: 100%;
        height: 150px;
        padding: 10px;
        margin-bottom: 10px;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-around;
    }

    .skeleton-logo {
        width: 40%;
        height: 30px;
    }

    .skeleton-profile {
        width: 40%;
        height: 60px;
    }

    .skeleton-menu-section {
        width: 45%;
        height: 50px;
    }

    #skeleton-loader .skeleton-main-content {
        width: 100%;
        gap: 10px;
        padding: 0;
    }

    #skeleton-loader .skeleton-header {
        height: 60px;
    }

    .skeleton-stats-overview {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .skeleton-stat-card {
        height: 100px;
    }

    .skeleton-table-section {
        padding: 10px;
        gap: 10px;
    }

    .skeleton-section-header {
        height: 25px;
        width: 80%;
    }

    .skeleton-table-filter-controls {
        flex-direction: column;
        gap: 8px;
    }

    .skeleton-search-input {
        width: 100%;
    }

    .skeleton-filter-buttons {
        width: 100%;
        justify-content: space-between;
    }

    .skeleton-filter-buttons > div {
        width: 30%;
        height: 35px;
    }

    .skeleton-add-button {
        width: 100%;
        margin-left: 0;
    }

    .skeleton-table-row {
        height: 35px;
        margin-bottom: 5px;
    }

    .skeleton-table-row.header {
        height: 45px;
    }

    .skeleton-pagination {
        width: 150px;
        height: 25px;
    }
}

/* Sales Summary Section Styles */
.sales-summary-section {
    background-color: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
}

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

.summary-card {
    background-color: var(--bg-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 8px 0 #d47272;
    transition: transform 0.2s ease;
}

.summary-card:hover {
    transform: translateY(-5px);
}

.summary-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    margin-bottom: 15px;
}

.summary-content h4 {
    margin: 0;
    font-size: 1em;
    color: var(--text-secondary);
}

.summary-content p {
    margin: 0;
    font-size: 1.8em;
    font-weight: 700;
    color: var(--text-primary);
}

.summary-icon {
    font-size: 1.5em;
    color: var(--primary-color);
}

.summary-graph {
    width: 100%;
    height: 80px;
    background-color: #f0f0f0;
    border-radius: var(--radius-md);
}

/* Responsive adjustments for Sales Summary Section */
@media (max-width: 768px) {
    .sales-summary-section {
        padding: 15px;
    }
    .sales-summary-section .section-header h3 {
        font-size: 1.2em;
        margin-bottom: 15px;
    }
    .summary-cards-grid {
        grid-template-columns: 1fr; /* Revert to single column for stability */
        gap: 15px;
    }
    .summary-card {
        padding: 15px;
        flex-direction: row; /* Align content and icon horizontally */
        justify-content: space-between;
        align-items: center;
    }
    .summary-icon {
        font-size: 1.5em;
        order: 2; /* Move icon to the right */
    }
    .summary-content p {
        font-size: 1.5em;
    }
    .summary-graph {
        display: none; /* Hide graph on mobile to save space */
    }
}