/* Orders Dashboard Styles */

.orders-dashboard {
    background: #f8f9fa;
    min-height: 100vh;
    padding: 20px;
    max-width: none;
    width: 100%;
}

/* Dashboard Header */
.dashboard-header {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Tab Navigation */
.tabs-container {
    background: white;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.tabs-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    border-bottom: 2px solid #e9ecef;
}

.tab-item {
    flex: 0 0 auto;
}

.tab-item a {
    display: block;
    padding: 10px 18px;
    color: #6c757d;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
    position: relative;
}

.tab-item a i {
    margin-right: 6px;
    font-size: 13px;
}

.tab-item a:hover {
    color: #667eea;
    background-color: #f8f9fa;
}

.tab-item.active a {
    color: #667eea;
    border-bottom-color: #667eea;
    background-color: #f8f9fa;
    font-weight: 600;
}

/* Filters Section */
.filters-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Table Section */
.table-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
}

.table-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Table Styles */
.orders-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.orders-table thead {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.orders-table thead th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.orders-table thead th:hover {
    background-color: #e9ecef;
}

.orders-table thead th .sort-icon {
    margin-left: 5px;
    font-size: 12px;
    color: #adb5bd;
}

.orders-table tbody tr {
    border-bottom: 1px solid #dee2e6;
    transition: background-color 0.2s;
}

.orders-table tbody tr:hover {
    background-color: #f8f9fa;
}

.orders-table tbody td {
    padding: 12px 15px;
    vertical-align: middle;
}

.orders-table tbody td.loading,
.orders-table tbody td.text-center {
    text-align: center;
    padding: 40px 15px;
    color: #6c757d;
}

/* Column-specific styles */
.col-order-id {
    min-width: 150px;
}

.col-store-id {
    min-width: 120px;
}

.col-order-date {
    min-width: 180px;
    color: #6c757d;
}

.col-total-cost {
    min-width: 120px;
    font-weight: 600;
}

.col-status {
    min-width: 120px;
}

.col-tracking {
    min-width: 180px;
}

.col-tracking a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.col-tracking a:hover {
    color: #5568d3;
    text-decoration: underline;
}

.col-delay {
    min-width: 100px;
    text-align: center;
}

.delay-warning {
    color: #ff9800;
    font-weight: 600;
}

.delay-critical {
    color: #dc3545;
    font-weight: 600;
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    color: white;
    text-align: center;
    white-space: nowrap;
    border-radius: 12px;
}

.badge-warning {
    background-color: #ffc107;
    color: #212529;
}

.badge-info {
    background-color: #17a2b8;
}

.badge-primary {
    background-color: #007bff;
}

.badge-success {
    background-color: #28a745;
}

.badge-danger {
    background-color: #dc3545;
}

.badge-secondary {
    background-color: #6c757d;
}

/* No Results */
.no-results {
    padding: 40px 20px;
    text-align: center;
}

.no-results i {
    display: block;
    margin-bottom: 15px;
}

.no-results p {
    color: #6c757d;
    font-size: 16px;
    margin: 0;
}

/* Pagination */
.pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    flex-wrap: wrap;
    gap: 15px;
}

.pagination-wrapper #pagination-info {
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
}

.pagination {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 5px;
}

.pagination .page-item {
    display: inline-block;
}

.pagination .page-link {
    display: block;
    padding: 6px 12px;
    color: #667eea;
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.pagination .page-link:hover {
    background-color: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination .page-item.active .page-link {
    background-color: #667eea;
    color: white;
    border-color: #667eea;
    font-weight: 600;
}

.pagination .page-item.disabled .page-link {
    color: #6c757d;
    background-color: #f8f9fa;
    border-color: #dee2e6;
    cursor: not-allowed;
    opacity: 0.5;
}

.pagination .page-item.disabled .page-link:hover {
    background-color: #f8f9fa;
    color: #6c757d;
    border-color: #dee2e6;
}

/* Loading spinner animation */
.fa-spinner {
    animation: spin 1s linear infinite;
}

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

/* Tracking Column Visibility */
.tracking-column {
    /* By default, tracking columns are visible */
}

.tracking-column.hidden {
    display: none !important;
}

/* Expand/Collapse Icon */
.col-expand {
    width: 40px;
    text-align: center;
    padding: 12px 10px !important;
}

.expand-icon {
    color: #667eea;
    font-size: 14px;
    transition: transform 0.2s ease;
}

.expand-icon:hover {
    color: #5568d3;
}

/* Line Items Row */
.line-items-row {
    background-color: #f8f9fa !important;
}

.line-items-row:hover {
    background-color: #f8f9fa !important;
}

/* Compact Line Items Container */
.line-items-container-compact {
    background-color: #f8f9fa;
    padding: 0;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    margin: 10px 15px;
}

.line-items-header {
    padding: 10px 15px;
    background-color: #e9ecef;
    font-weight: 600;
    color: #495057;
    font-size: 13px;
}

.line-items-header i {
    margin-right: 5px;
    color: #667eea;
}

/* Line Items Table */
.line-items-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 13px;
    border-radius: 4px;
    overflow: hidden;
}

.line-items-table tbody tr {
    border-bottom: 1px solid #e9ecef;
}

.line-items-table tbody tr:last-child {
    border-bottom: none;
}

.line-items-table tbody tr:hover {
    background-color: #f8f9fa;
}

.line-items-table tbody td {
    padding: 10px 12px;
    vertical-align: middle;
}

.line-item-name {
    font-weight: 500;
    color: #212529;
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.line-item-cost {
    text-align: left;
    width: 120px;
    font-weight: 500;
    white-space: nowrap;
}

.line-item-tracking {
    width: auto;
    white-space: nowrap;
}

.line-item-tracking a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.line-item-tracking a:hover {
    color: #5568d3;
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .orders-dashboard {
        padding: 15px;
    }
    
    .dashboard-header {
        padding: 20px;
    }
    
    .dashboard-header h2 {
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    .tabs-nav {
        flex-direction: column;
    }

    .tab-item {
        width: 100%;
    }

    .tab-item a {
        padding: 12px 20px;
        text-align: center;
    }

    .filter-row {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
        min-width: auto;
    }

    .filter-group button {
        margin-top: 0;
        width: 100%;
    }

    .pagination-wrapper {
        flex-direction: column;
        text-align: center;
    }

    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }

    .table-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .orders-table {
        font-size: 12px;
    }

    .orders-table thead th,
    .orders-table tbody td {
        padding: 8px 10px;
    }

    /* Line items responsive */
    .line-items-table {
        font-size: 12px;
    }

    .line-items-table tbody td {
        padding: 8px 10px;
    }

    .line-item-name {
        max-width: 150px;
    }

    .line-item-tracking {
        font-size: 11px;
    }
}

@media (max-width: 576px) {
    .dashboard-header h2 {
        font-size: 20px;
    }
    
    .dashboard-header p {
        font-size: 12px;
    }
    
    .orders-table {
        font-size: 11px;
    }
    
    .badge {
        padding: 4px 8px;
        font-size: 10px;
    }
}

/* ========== SOURCING QUOTES STYLES ========== */

/* Sourcing Quotes Row */
.sourcing-quotes-row {
    background-color: #f8f9fa !important;
}

.sourcing-quotes-row:hover {
    background-color: #f8f9fa !important;
}

/* Sourcing Quotes Container */
.sourcing-quotes-container {
    background-color: #f8f9fa;
    padding: 0;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    margin: 10px 15px;
    overflow: hidden;
}

.sourcing-quotes-header {
    padding: 12px 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.sourcing-quotes-header i {
    margin-right: 8px;
    font-size: 16px;
}

/* Sourcing Quotes List */
.sourcing-quotes-list {
    padding: 15px;
    background: white;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Sourcing Quote Card */
.sourcing-quote-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.3s ease;
}

.sourcing-quote-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Quote Card Header */
.quote-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
}

.quote-supplier-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.quote-supplier-name {
    font-weight: 600;
    color: #212529;
    font-size: 14px;
}

/* Quote Card Body */
.quote-card-body {
    padding: 15px;
    background: white;
}

.quote-info-row {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

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

.quote-info-item {
    flex: 1;
    min-width: 150px;
}

.quote-info-item.full-width {
    flex: 1 1 100%;
}

.quote-info-item label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.quote-info-item span,
.quote-info-item a {
    display: block;
    font-size: 13px;
    color: #212529;
}

.quote-amount {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #28a745 !important;
}

.quote-comment {
    padding: 10px;
    background: #f8f9fa;
    border-left: 3px solid #667eea;
    border-radius: 4px;
    font-size: 13px;
    color: #495057;
    line-height: 1.5;
    margin-top: 4px;
}

/* Quote Images Section */
.quote-images-section {
    width: 100%;
    display: block;
    clear: both;
    margin-top: 15px;
    margin-left: 0;
    margin-right: auto;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.quote-images-section label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.quote-images-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
    align-items: center;
}

.quote-image-thumb {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid #e9ecef;
    transition: all 0.2s ease;
}

.quote-image-thumb:hover {
    border-color: #667eea;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.quote-image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.quote-images-more {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 6px;
    color: #6c757d;
    font-size: 12px;
    font-weight: 600;
}

/* Quote Card Actions */
.quote-card-actions {
    padding: 12px 15px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
}

.quote-card-actions .btn {
    font-size: 13px;
    padding: 6px 16px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.quote-card-actions .btn i {
    font-size: 12px;
}

.quote-card-actions .btn-success {
    background: #28a745;
    border-color: #28a745;
    color: white;
}

.quote-card-actions .btn-success:hover {
    background: #218838;
    border-color: #1e7e34;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.quote-card-actions .btn-danger {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
}

.quote-card-actions .btn-danger:hover {
    background: #c82333;
    border-color: #bd2130;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.quote-card-actions .btn-secondary {
    background: #6c757d;
    border-color: #6c757d;
    color: white;
}

.quote-card-actions .btn-secondary:hover {
    background: #5a6268;
    border-color: #545b62;
    transform: translateY(-1px);
}

.quote-card-actions .btn-primary {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

.quote-card-actions .btn-primary:hover {
    background: #5568d3;
    border-color: #4c5fc4;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.quote-card-actions .alert {
    margin: 0;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quote-card-actions .alert i {
    font-size: 14px;
}

.quote-card-actions .alert-success {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.quote-card-actions .alert-info {
    background: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

.quote-card-actions .alert-danger {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* Link Styles */
.link-field {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.link-field:hover {
    color: #5568d3;
    text-decoration: underline;
}

.link-field i {
    margin-right: 4px;
    font-size: 12px;
}

/* Responsive Sourcing Quotes */
@media (max-width: 768px) {
    .sourcing-quotes-container {
        margin: 10px 5px;
    }
    
    .quote-info-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .quote-info-item {
        min-width: 100%;
    }
    
    .quote-images-grid {
        gap: 8px;
    }
    
    .quote-image-thumb {
        width: 80px;
        height: 80px;
    }
    
    .quote-images-more {
        width: 80px;
        height: 80px;
    }
    
    .quote-card-actions {
        flex-direction: column;
    }
    
    .quote-card-actions .btn {
        width: 100%;
        justify-content: center;
    }
}
