﻿/* Supplier Expenditure Report Styles */
.ser-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 1rem;
}

.ser-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Breadcrumb Navigation */
.ser-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ser-breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

    .ser-breadcrumb-item:hover {
        background: #f1f5f9;
        color: #3b82f6;
    }

.ser-breadcrumb-current {
    color: #1e293b;
    font-weight: 600;
}

.ser-breadcrumb-separator {
    color: #cbd5e1;
    font-size: 0.875rem;
}

/* Header */
.ser-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.ser-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ser-header-icon {
    width: 4rem;
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 1rem;
    color: white;
    font-size: 1.5rem;
}

.ser-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.5rem 0;
}

.ser-subtitle {
    font-size: 1rem;
    color: #64748b;
    margin: 0;
}

.ser-header-actions {
    display: flex;
    gap: 0.75rem;
}

/* Cards */
.ser-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.ser-card-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-bottom: 1px solid #e2e8f0;
}

.ser-card-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
}

.ser-card-body {
    padding: 1.5rem;
}

/* Selection Sections */
.ser-selection-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ser-selection-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #374151;
    font-size: 1rem;
}

.ser-selection-options {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.ser-select-all-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .ser-select-all-btn:hover {
        background: #e5e7eb;
        border-color: #9ca3af;
    }

    .ser-select-all-btn.active {
        background: #3b82f6;
        border-color: #3b82f6;
        color: white;
    }

.ser-search-box {
    position: relative;
    flex: 1;
    max-width: 300px;
}

.ser-search-input {
    width: 100%;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

.ser-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 0.875rem;
}

/* Checkbox Grid */
.ser-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 0.75rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background: #f9fafb;
}

.ser-supplier-grid {
    max-height: 400px;
}

.ser-checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .ser-checkbox-item:hover {
        border-color: #3b82f6;
        box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
    }

    .ser-checkbox-item input[type="checkbox"] {
        margin: 0;
        width: 1rem;
        height: 1rem;
        accent-color: #3b82f6;
    }

.ser-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #374151;
    flex: 1;
}

    .ser-checkbox-label strong {
        color: #1f2937;
    }

.ser-more-results {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: #f3f4f6;
    border: 1px dashed #d1d5db;
    border-radius: 0.5rem;
    color: #6b7280;
    font-size: 0.875rem;
    font-style: italic;
}

.ser-selection-summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
    border-radius: 0.5rem;
    color: #065f46;
    font-size: 0.875rem;
    font-weight: 500;
}

    .ser-selection-summary.ser-all-selected {
        background: #eff6ff;
        border-color: #bfdbfe;
        color: #1e40af;
    }

/* Period Selection */
.ser-quick-periods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.ser-period-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

    .ser-period-btn:hover {
        border-color: #3b82f6;
        box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
    }

    .ser-period-btn.active {
        border-color: #3b82f6;
        background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
        color: white;
    }

    .ser-period-btn i {
        font-size: 1.25rem;
    }

    .ser-period-btn span {
        font-size: 0.875rem;
        font-weight: 500;
    }

/* Custom Date Range */
.ser-custom-range {
    display: flex;
    align-items: end;
    gap: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
}

.ser-date-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ser-date-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.ser-date-input {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.ser-date-separator {
    display: flex;
    align-items: center;
    color: #6b7280;
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.ser-selected-period {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #f0f9ff;
    border: 1px solid #0ea5e9;
    border-radius: 0.5rem;
    color: #0c4a6e;
    font-weight: 500;
}

/* Stats Grid */
.ser-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.ser-stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-left: 4px solid;
}

.ser-stat-primary {
    border-left-color: #3b82f6;
}

.ser-stat-success {
    border-left-color: #10b981;
}

.ser-stat-info {
    border-left-color: #0ea5e9;
}

.ser-stat-warning {
    border-left-color: #f59e0b;
}

.ser-stat-icon {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    font-size: 1.25rem;
    color: white;
}

.ser-stat-primary .ser-stat-icon {
    background: #3b82f6;
}

.ser-stat-success .ser-stat-icon {
    background: #10b981;
}

.ser-stat-info .ser-stat-icon {
    background: #0ea5e9;
}

.ser-stat-warning .ser-stat-icon {
    background: #f59e0b;
}

.ser-stat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ser-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
}

.ser-stat-label {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
}

/* Suppliers Table */
.ser-suppliers-table {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
}

.ser-table-header,
.ser-table-row {
    display: grid;
    grid-template-columns: 60px 1fr 80px 120px 120px 80px;
    gap: 1rem;
    align-items: center;
    padding: 0.75rem 1rem;
}

.ser-table-header {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
}

.ser-table-row {
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s ease;
}

    .ser-table-row:hover {
        background: #f9fafb;
    }

    .ser-table-row.ser-top-three {
        background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
        font-weight: 600;
    }

.ser-rank-col {
    text-align: center;
    font-weight: 600;
}

.ser-gold {
    color: #f59e0b;
}

.ser-silver {
    color: #6b7280;
}

.ser-bronze {
    color: #92400e;
}

.ser-supplier-col {
    min-width: 0;
}

.ser-supplier-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ser-supplier-name {
    font-size: 0.875rem;
    color: #64748b;
}

.ser-orders-col,
.ser-share-col {
    text-align: center;
    font-weight: 500;
}

.ser-amount-col,
.ser-avg-col {
    text-align: right;
    font-weight: 600;
    color: #059669;
}

/* Company Grid */
.ser-company-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.ser-company-item {
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    transition: all 0.2s ease;
}

    .ser-company-item:hover {
        border-color: #3b82f6;
        box-shadow: 0 4px 8px rgba(59, 130, 246, 0.1);
    }

.ser-company-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.ser-company-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #1f2937;
}

.ser-company-amount {
    font-weight: 700;
    color: #059669;
    font-size: 1.125rem;
}

.ser-company-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.ser-company-bar {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.ser-company-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 100%);
    transition: width 0.3s ease;
}

/* Export Actions */
.ser-export-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.ser-export-info {
    font-size: 0.875rem;
    color: #64748b;
    max-width: 600px;
    line-height: 1.5;
}

/* Loading State */
.ser-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 3rem;
    text-align: center;
}

    .ser-loading i {
        font-size: 2rem;
        color: #3b82f6;
    }

    .ser-loading p {
        font-size: 1rem;
        color: #64748b;
        margin: 0;
    }

/* Responsive Design */
@media (max-width: 768px) {
    .ser-container {
        padding: 0 0.5rem;
    }

    .ser-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .ser-quick-periods {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .ser-stats-grid {
        grid-template-columns: 1fr;
    }

    .ser-table-header,
    .ser-table-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .ser-company-grid {
        grid-template-columns: 1fr;
    }

    .ser-custom-range {
        flex-direction: column;
        gap: 1rem;
    }

    .ser-date-separator {
        transform: rotate(90deg);
    }
}


/* Category Breakdown Styles */
.ser-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.ser-category-item {
    background: #fff;
    border-radius: 8px;
    padding: 1.25rem;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

    .ser-category-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    }

.ser-category-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.ser-category-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

    .ser-category-info i {
        font-size: 1.5rem;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        color: white;
    }

.ser-category-details strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #2c3e50;
}

.ser-category-details span {
    display: block;
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 2px;
}

.ser-category-amount {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
}

.ser-category-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

    .ser-category-stats span {
        background: #f8f9fa;
        padding: 0.25rem 0.5rem;
        border-radius: 4px;
        font-size: 0.75rem;
        color: #6c757d;
        font-weight: 500;
    }

.ser-category-bar {
    width: 100%;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.ser-category-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.6s ease;
}

/* Category-specific colors */
.ser-category-plant {
    border-color: #27ae60;
}

    .ser-category-plant .ser-category-info i {
        background: #27ae60;
    }

    .ser-category-plant .ser-category-fill {
        background: linear-gradient(90deg, #27ae60, #2ecc71);
    }

.ser-category-vehicles {
    border-color: #3498db;
}

    .ser-category-vehicles .ser-category-info i {
        background: #3498db;
    }

    .ser-category-vehicles .ser-category-fill {
        background: linear-gradient(90deg, #3498db, #5dade2);
    }

.ser-category-ppe {
    border-color: #e74c3c;
}

    .ser-category-ppe .ser-category-info i {
        background: #e74c3c;
    }

    .ser-category-ppe .ser-category-fill {
        background: linear-gradient(90deg, #e74c3c, #ec7063);
    }

.ser-category-general {
    border-color: #f39c12;
}

    .ser-category-general .ser-category-info i {
        background: #f39c12;
    }

    .ser-category-general .ser-category-fill {
        background: linear-gradient(90deg, #f39c12, #f4d03f);
    }

.ser-category-default {
    border-color: #95a5a6;
}

    .ser-category-default .ser-category-info i {
        background: #95a5a6;
    }

    .ser-category-default .ser-category-fill {
        background: linear-gradient(90deg, #95a5a6, #bdc3c7);
    }

/* Enhanced card subtitle */
.ser-card-subtitle {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 500;
    margin-top: 0.25rem;
    font-style: italic;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .ser-category-grid {
        grid-template-columns: 1fr;
    }

    .ser-category-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .ser-category-amount {
        align-self: flex-start;
    }
}

/* Animation for category bars */
@keyframes fillCategory {
    from {
        width: 0%;
    }

    to {
        width: var(--fill-width);
    }
}

.ser-category-fill {
    animation: fillCategory 1s ease-out 0.5s both;
}