/* ==================== */
/* Invoice Dashboard */
/* ==================== */
.invoice-dashboard {
    max-width: 1200px;
    margin: auto;
    font-family: Arial, sans-serif;
    padding: 20px;
}

/* Notification Alert */
.notification-alert {
    background: #fff; /* White background */
    padding: 15px;
    border-left: 5px solid #FF9800;
    border-radius: 8px; /* Rounded corners */
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); /* Shadow like shipment dashboard */
}

.notification-alert .icon {
    font-size: 20px;
    color: #FF9800;
}

.notification-alert p {
    margin: 0;
    font-size: 14px;
    color: #333;
}

/* Date Filter - Modern Design */
.date-filter {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.date-filter label {
    font-size: 14px;
    color: #333;
}

.date-filter input {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    width: 150px;
}

.date-filter button {
    padding: 8px 16px;
    background-color: #CC631B; /* Orange */
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.date-filter button:hover {
    background-color: #b35215; /* Darker orange */
}

/* KPI Tiles */
.kpi-tiles {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.kpi-tile {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden; /* Prevent content from breaking the tile*/
}

.kpi-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.kpi-tile .content {
    text-align: left;
    flex: 1; /* Allow content to grow and take available space */
    min-width: 0; /* Prevent flex items from overflowing */
}

.kpi-tile .number {
    font-size: 28px;
    font-weight: bold;
    color: #0F1436; /* Sea blue */
    word-break: break-word; /* Break long words if necessary */
    overflow-wrap: break-word; /* Ensure words break to prevent overflow */
    flex-direction: column; /* Stack numbers vertically */
    text-overflow: ellipsis; /* Add ellipsis if number is too long */
}

.kpi-tile .title {
    font-size: 14px;
    color: #666;
    white-space: nowrap; /* Prevent title from wrapping */
    overflow: hidden; /* Hide overflow */
    text-overflow: ellipsis; /* Add ellipsis if title is too long */
}

.kpi-tile .count-circle {
    font-size: 12px;
    color: #fff;
    background: #1E90FF; /* Light blue */
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 5px;
    flex-shrink: 0; /* Prevent icon from shrinking */
}

.kpi-tile .icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(204, 99, 27, 0.1); /* Light orange */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* Prevent icon from shrinking */
}

.kpi-tile .icon svg {
    width: 24px;
    height: 24px;
    fill: #CC631B; /* Orange */
}

/* Modern Table */
.invoice-table-container {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.invoice-table th {
    background: #f9f9f9;
    padding: 12px;
    text-align: left;
    font-weight: bold;
    color: #333;
    position: sticky; /* Make header sticky */
    top: 0; /* Stick to the top */
    z-index: 2; /* Ensure header is above rows */
}

.invoice-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    border-left: none; /* Hide vertical borders */
    border-right: none; /* Hide vertical borders */
}

/* Remove alternating row colors and hover effect */
.invoice-table tr {
    background: #fff; /* All rows have the same background */
}

/* View Invoice Link */
.invoice-table .view-invoice-link {
    color: #CC631B; /* Orange */
    text-decoration: none;
    font-weight: bold;
}

.invoice-table .view-invoice-link:hover {
    text-decoration: underline;
}

/* Recent Activity and Yearly Totals Section */
.recent-activity-yearly-totals {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.recent-activity {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.recent-activity h3 {
    margin-top: 0;
    font-size: 18px;
    color: #CC631B; /* Orange */
}

.recent-activity ul {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
}

.recent-activity li {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    color: #666;
}

.recent-activity li:last-child {
    border-bottom: none;
}

.recent-activity .time-elapsed {
    font-size: 12px;
    color: #999;
    margin-left: 10px;
}

.yearly-totals {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.yearly-totals h3 {
    margin-top: 0;
    font-size: 18px;
    color: #CC631B; /* Orange */
}

.yearly-totals .totals-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.yearly-totals .total-item {
    text-align: center;
    padding: 10px;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
}

.yearly-totals .total-item .number {
    font-size: 20px;
    font-weight: bold;
    color: #0F1436; /* Sea blue */
}

.yearly-totals .total-item .title {
    font-size: 14px;
    color: #666;
}

/* Charts Section */
.charts-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.chart-container-invoices {
    flex: 1;
    background: #fff;
    padding: 20px;
    overflow: hidden;
    border-radius: 8px;
    position: relative;
    box-sizing: border-box;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    height: 400px; /* Fixed height for better visibility */
}

/* Chart Navigation Buttons */
.chart-navigation {
    display: none; /* Hidden by default */
    justify-content: space-between;
    margin-bottom: 10px;
}

.chart-navigation button {
    padding: 6px 12px;
    background-color: #CC631B; /* Orange */
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.chart-navigation button:hover {
    background-color: #b35215; /* Darker orange */
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .kpi-tiles {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
    
     .kpi-tile {
        padding: 15px; /* Reduce padding for smaller screens */
       
    }

    .kpi-tile .number {
        font-size: 18px; /* Adjust font size for smaller screens */
        white-space: normal; /* Allow text to wrap */
        word-break: break-word; /* Break long words if necessary */
        overflow-wrap: break-word; /* Ensure words break to prevent overflow */
        display: flex;
        flex-direction: column; /* Stack numbers vertically */
        align-items: flex-start; /* Align numbers to the left */
    }

    .kpi-tile .title {
        font-size: 12px; /* Adjust font size for smaller screens */
       
    }
    
    .kpi-tile .icon {
        width: 40px; /* Even smaller for very small screens */
        height: 40px;
        margin-left: auto; /* Push icon to the right */
        flex-shrink: 0; /* Prevent icon from shrinking */
    }

    .kpi-tile .icon svg {
        width: 16px; /* Smaller SVG for very small screens */
        height: 16px;
    }

    .invoice-table-container {
        overflow-x: auto;
    }

    .recent-activity-yearly-totals {
        grid-template-columns: 1fr;
    }

    .yearly-totals .totals-grid {
        grid-template-columns: 1fr;
    }

    .notification-alert {
        flex-direction: column;
        align-items: flex-start;
    }

    .date-filter {
        flex-direction: column;
    }

    .date-filter label,
    .date-filter input,
    .date-filter button {
        width: 100%;
    }

    .charts-section {
        grid-template-columns: 1fr;
    }

    .chart-container-invoices {
        height: 300px; /* Adjust height for mobile */
    }

    .chart-navigation {
        display: flex; /* Show buttons only in mobile view */
    }
}

/* Loading Spinner Styles */
#loading-spinner-main {
    position: fixed;
    top: 50%;
    display: flex;
    flex-direction: column;
    left: 50%;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#loading-spinner-main .spinner-main {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #CC631B;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

