/* Supplier Orders Page Styles */

.supplier-orders-page {
    padding: 20px;
    max-width: 1280px;  /* Reduced from 1400px to fit standard laptops */
    margin: 0 auto;
}

/* Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.header-left h1 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 28px;
    font-weight: 600;
    color: #1f2937;
}

.header-icon {
    color: #6366f1;
}

.header-subtitle {
    margin-top: 4px;
    color: #6b7280;
    font-size: 14px;
}

.header-actions {
    display: flex;
    gap: 12px;
}

/* Main Tabs Section */
.main-tabs-section {
    margin-bottom: 24px;
}

.main-tabs-container {
    display: flex;
    gap: 16px;
    background: white;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.main-tab-button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 24px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.main-tab-button:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #4b5563;
}

.main-tab-button.active {
    background: #6366f1;
    border-color: #6366f1;
    color: white;
}

.main-tab-button.active svg {
    color: white;
}

.main-tab-button svg {
    flex-shrink: 0;
}

/* Tabbed Content Container */
.tabbed-content-container {
    margin-top: 24px;
    position: relative;
}

/* Top Section */
.top-section {
    background: transparent;
    margin-bottom: 0;
}

/* Tabs Navigation - Redesigned to connect with table */
.tabs-navigation {
    background: transparent;
    margin-bottom: 0;
    position: relative;
    z-index: 10;
}

.tabs-container {
    display: flex;
    flex-wrap: wrap;  /* Allow tabs to wrap on smaller screens */
    gap: 4px;
    padding: 0;
}

.tab-button {
    display: flex;
    align-items: center;
    gap: 6px;  /* Reduced from 8px */
    padding: 10px 16px;  /* Reduced from 12px 24px */
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    color: #6b7280;
    font-size: 13px;  /* Reduced from 14px */
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    position: relative;
}

.tab-button:hover {
    background: #e5e7eb;
    color: #4b5563;
}

.tab-button.active {
    background: white;
    color: #1f2937;
    border-color: #d1d5db;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.05);
    font-weight: 600;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: -1px;
    right: -1px;
    height: 3px;
    background: white;
    z-index: 1;
}

.tab-label {
    font-weight: 500;
}

.tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.tab-button.active .tab-count {
    background: #6366f1;
    color: white;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    background: #e5e7eb;
    color: #4b5563;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.tab-button.active .tab-count {
    background: #6366f1;
    color: white;
}

/* Tab Content Area */
.tab-content-area {
    background: white;
    border: 1px solid #d1d5db;
    border-top: none;
    border-radius: 0 8px 0 0;
    padding: 20px;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: -1px;
}

/* Stats Bar */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: #f9fafb;
    padding: 16px;
    border-radius: 8px;
    text-align: center;
}

.stat-card.highlight {
    background: #eef2ff;
    border: 2px solid #6366f1;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1;
}

.stat-label {
    margin-top: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Filters Bar */
.filters-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.filters-left,
.filters-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Search Box */
.search-box {
    position: relative;
    min-width: 300px;
}

.search-box input {
    width: 100%;
    padding: 10px 40px 10px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-box svg {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

/* Filter Select */
.filter-select {
    padding: 10px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Bottom Section - Connected to tabs */
.bottom-section {
    background: white;
    border: 1px solid #d1d5db;
    border-top: none;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin-top: 0;
}

/* Orders Table */
.orders-table-container {
    overflow-x: auto;
}

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

.orders-table thead {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.orders-table th {
    padding: 10px 12px;  /* Reduced padding */
    text-align: left;
    font-size: 11px;  /* Smaller font */
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

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

.orders-table td {
    padding: 12px;  /* Reduced from 16px */
    font-size: 13px;  /* Reduced from 14px */
    color: #1f2937;
}

.checkbox-column {
    width: 40px;
    text-align: center;
}

.order-number {
    font-weight: 600;
}

.order-link {
    color: #6366f1;
    text-decoration: none;
    transition: color 0.2s;
}

.order-link:hover {
    color: #4f46e5;
    text-decoration: underline;
}

/* Source Badge */
.source-badge {
    display: inline-block;
    padding: 4px 12px;
    background: #f3f4f6;
    color: #4b5563;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* Item Count */
.item-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    background: #eef2ff;
    color: #6366f1;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 600;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Actions Column */
.actions-column {
    display: flex;
    gap: 8px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: #6366f1;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #4f46e5;
}

.btn-secondary {
    background: #f3f4f6;
    color: #4b5563;
}

.btn-secondary:hover:not(:disabled) {
    background: #e5e7eb;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-icon {
    padding: 8px;
    border-radius: 6px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon:hover:not(:disabled) {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.btn-icon svg {
    display: block;
    flex-shrink: 0;
}

.btn .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    margin-left: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #6b7280;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-state p {
    margin-top: 16px;
    font-size: 14px;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-state svg {
    color: #d1d5db;
    margin-bottom: 16px;
}

.empty-state h3 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
    color: #4b5563;
}

.empty-state p {
    margin: 0;
    font-size: 14px;
    color: #9ca3af;
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.pagination-info {
    font-size: 14px;
    color: #6b7280;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-info {
    font-size: 14px;
    color: #4b5563;
}

/* Responsive Design for Standard Laptops */
@media (max-width: 1366px) {
    .supplier-orders-page {
        max-width: 100%;
        padding: 15px;
    }

    .tab-button {
        padding: 8px 12px;
        font-size: 12px;
    }

    .orders-table th,
    .orders-table td {
        padding: 12px 10px;
        font-size: 13px;
    }
}

/* Responsive Design for Tablets */
@media (max-width: 768px) {
    .supplier-orders-page {
        padding: 12px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .tabs-container {
        padding: 0 8px;
    }
    
    .tab-button {
        padding: 12px 16px;
        font-size: 13px;
    }
    
    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filters-left,
    .filters-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .search-box {
        min-width: 100%;
    }
    
    .orders-table {
        font-size: 13px;
    }
    
    .orders-table th,
    .orders-table td {
        padding: 12px 8px;
    }
    
    .pagination-container {
        flex-direction: column;
        gap: 12px;
    }
}

/* Scrollbar Styling */
.tabs-navigation::-webkit-scrollbar {
    height: 4px;
}

.tabs-navigation::-webkit-scrollbar-track {
    background: #f3f4f6;
}

.tabs-navigation::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

.tabs-navigation::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}