/* Component-specific styles for ACC Portal */

/* Dashboard Components */
.dashboard-card {
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e3e6f0;
    border-radius: 0.375rem;
}

.dashboard-card .card-header {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
    padding: 1rem 1.25rem;
}

.stats-box {
    padding: 1.25rem;
    border-radius: 0.375rem;
    margin-bottom: 1.5rem;
    text-align: center;
    border: 1px solid transparent;
}

.stats-box h3 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.stats-box p {
    margin-bottom: 0;
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
}

.stats-box.primary {
    background-color: #cfe2ff;
    color: #084298;
    border-color: #b6d7ff;
}

.stats-box.success {
    background-color: #d1e7dd;
    color: #0f5132;
    border-color: #badbcc;
}

.stats-box.warning {
    background-color: #fff3cd;
    color: #664d03;
    border-color: #ffecb5;
}

.stats-box.danger {
    background-color: #f8d7da;
    color: #842029;
    border-color: #f5c2c7;
}

.stats-box.info {
    background-color: #cff4fc;
    color: #055160;
    border-color: #b6effb;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Product Components */
.product-header {
    background-color: #f8f9fa;
    padding: 1.25rem;
    border-radius: 0.375rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e3e6f0;
}

.product-header h2 {
    margin-bottom: 1rem;
    color: #495057;
    font-weight: 600;
}

.product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.product-meta-item {
    flex: 1;
    min-width: 200px;
}

.product-meta-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.25rem;
    display: block;
}

.product-list-header {
    background-color: #f8f9fa;
    padding: 1.25rem;
    border-radius: 0.375rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e3e6f0;
}

.detail-card {
    margin-bottom: 2rem;
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 10px;
}

.detail-card .card-header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border-radius: 10px 10px 0 0 !important;
    border: none;
}


/* Stock Components */
.stock-card {
    margin-bottom: 1.5rem;
}

.stock-total {
    font-size: 1.5rem;
    font-weight: 600;
    color: #0d6efd;
}

.stock-location {
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.375rem;
    background-color: #f8f9fa;
    border: 1px solid #e3e6f0;
}

.stock-location-name {
    font-weight: 600;
    color: #495057;
}

.stock-quantity {
    font-weight: 600;
    color: #198754;
}

.stock-quantity.negative {
    color: #dc3545;
}

/* Orders Components */
.orders-summary {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.orders-summary-card {
    flex: 1;
    padding: 1rem;
    border-radius: 0.375rem;
    text-align: center;
    border: 1px solid;
}

.orders-summary-card.open-orders {
    background-color: #cff4fc;
    border-color: #b6effb;
    color: #055160;
}

.orders-summary-card.back-orders {
    background-color: #fff3cd;
    border-color: #ffecb5;
    color: #664d03;
}

.orders-summary-card.stock-orders {
    background-color: #d1e7dd;
    border-color: #badbcc;
    color: #0f5132;
}

.orders-total {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.orders-breakdown {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
}

/* Invoice Components */
.invoice-header {
    background-color: #f8f9fa;
    padding: 1.25rem;
    border-radius: 0.375rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e3e6f0;
}

.invoice-header h2 {
    margin-bottom: 1rem;
    color: #495057;
    font-weight: 600;
}

.invoice-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.invoice-meta-item {
    flex: 1;
    min-width: 200px;
}

.invoice-meta-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.25rem;
    display: block;
}

.invoice-totals {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.375rem;
    margin-top: 1.5rem;
    border: 1px solid #e3e6f0;
}

.invoice-total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.invoice-grand-total {
    font-weight: 600;
    font-size: 1.125rem;
    border-top: 2px solid #dee2e6;
    padding-top: 0.75rem;
    color: #495057;
}

/* Form Components */
.date-range-form {
    background-color: #f8f9fa;
    padding: 1.25rem;
    border-radius: 0.375rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e3e6f0;
}

.date-range-form .row {
    align-items: end;
}

/* Utility Classes */
.back-link {
    margin-bottom: 1.5rem;
}

.section-title {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #dee2e6;
    color: #495057;
    font-weight: 600;
}

/* Product List Components */
.sortable-header {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 1.25rem;
    transition: background-color 0.15s ease-in-out;
}

.sortable-header:hover {
    background-color: #e9ecef;
}

.sort-icon {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8em;
    color: #6c757d;
    transition: color 0.15s ease-in-out;
}

.sort-icon.active {
    color: #0d6efd;
}

.filter-section {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e3e6f0;
}

.filter-section h6 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 1rem;
}

.filter-row {
    margin-bottom: 0.75rem;
}

.filter-row:last-child {
    margin-bottom: 0;
}

.product-status {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-active {
    background-color: #d1e7dd;
    color: #0f5132;
}

.status-inactive {
    background-color: #f8d7da;
    color: #842029;
}

.status-pending {
    background-color: #fff3cd;
    color: #664d03;
}

/* Profile Components */
.avatar-placeholder {
    margin-bottom: 1rem;
    width: 80px;
    height: 80px;
    background-color: #e9ecef;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #6c757d;
}

.profile-section {
    margin-bottom: 1.5rem;
}

.profile-section h5 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

.profile-info-row {
    margin-bottom: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f8f9fa;
}

.profile-info-row:last-child {
    border-bottom: none;
}

.profile-badge {
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

/* User Management Components */
.user-role-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-weight: 500;
}

.user-actions {
    white-space: nowrap;
}

.user-actions .btn {
    margin-right: 0.25rem;
}

.user-actions .btn:last-child {
    margin-right: 0;
}

.user-group-header {
    background-color: #f8f9fa;
    padding: 0.75rem 1rem;
    margin: 1rem 0 0.5rem 0;
    border-radius: 0.375rem;
    font-weight: 600;
    color: #495057;
    border: 1px solid #e3e6f0;
}

.user-group-header:first-child {
    margin-top: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .orders-summary {
        flex-direction: column;
    }
    
    .product-meta {
        flex-direction: column;
        gap: 1rem;
    }
    
    .invoice-meta {
        flex-direction: column;
        gap: 1rem;
    }
    
    .sortable-header {
        padding-right: 1rem;
    }
    
    .sort-icon {
        right: 0.25rem;
    }
    
    .avatar-placeholder {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }
    
    .user-actions {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .user-actions .btn {
        margin-right: 0;
        width: 100%;
    }
    
    .filter-section {
        padding: 0.75rem;
    }
    
    .stats-box {
        padding: 1rem;
    }
    
    .product-header,
    .invoice-header,
    .date-range-form {
        padding: 1rem;
    }
}

/* Print styles */
@media print {
    .user-actions,
    .filter-section,
    .back-link {
        display: none;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
    
    .stats-box {
        border: 1px solid #dee2e6;
        margin-bottom: 1rem;
    }
}
