/* ========================================
   TRANSACTION LIST COMMON STYLES
   Filters, Sorting, and Pagination
   ======================================== */

/* Filter Section Styles */
.filters-section {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.filters-header {
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.filters-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}

.filters-header h3:hover {
    color: #4f46e5;
}

.btn-clear-filters {
    background: transparent;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-clear-filters:hover {
    background: #f3f4f6;
    color: #374151;
    border-color: #d1d5db;
}

.filters-content {
    padding: 0 1.5rem 1.5rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    animation: slideDown 0.3s ease-out;
}

.filter-group {
    flex: 1;
    min-width: 250px;
}

.filter-group label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

/* Filter Panel Styles */
.filter-panel {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.text-filter {
    flex: 1;
    min-width: 200px;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: all 0.2s;
    background: white;
}

.text-filter:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.text-filter::placeholder {
    color: #9ca3af;
}

/* Date Range Filter Styles */
.date-range-panel {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.75rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.date-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    flex: 1;
    min-width: 150px;
}

.date-input-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.date-picker {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: all 0.2s;
    background: white;
}

.date-picker:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Checkbox Filter Styles */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #4f46e5;
}

/* Sortable Table Header Styles */
.modern-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: all 0.2s;
}

.modern-table th.sortable:hover {
    background: #f3f4f6;
    color: #4f46e5;
}

.modern-table th.sortable .bi {
    font-size: 0.75rem;
    margin-left: 0.25rem;
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    margin-top: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.pagination-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #6b7280;
    font-size: 0.875rem;
}

.page-size-selector {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.page-size-selector:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.pagination-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-page {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e5e7eb;
    background: white;
    color: #374151;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

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

.btn-page.active {
    background: #4f46e5;
    color: white;
    border-color: #4f46e5;
}

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

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .filters-content {
        flex-direction: column;
    }

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

    .pagination-container {
        flex-direction: column;
        align-items: stretch;
    }

    .pagination-info {
        justify-content: center;
    }

    .pagination-controls {
        justify-content: center;
    }
}

/* ========================================
   MISSING STYLES (Added to fix UI)
   ======================================== */

/* Page Containers */
.orders-container,
.invoices-container,
.page-container {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    animation: fadeIn 0.5s ease-out;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Headers */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

h1 {
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    font-size: 1.875rem;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
    background: white;
    color: #4b5563;
    border: 1px solid #d1d5db;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.btn-icon {
    background: transparent;
    border: 1px solid #e5e7eb;
    color: #6b7280;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 0.25rem;
}

.btn-icon:hover {
    background: #f3f4f6;
    color: #111827;
    border-color: #d1d5db;
}

/* Action Button Variants */
.btn-icon.edit:hover {
    color: #2563eb;
    border-color: #bfdbfe;
    background: #eff6ff;
}

.btn-icon.delete:hover {
    color: #dc2626;
    border-color: #fecaca;
    background: #fef2f2;
}

.btn-icon.confirm {
    color: #059669;
    border-color: #a7f3d0;
    background: #ecfdf5;
}

.btn-icon.confirm:hover {
    background: #d1fae5;
    border-color: #6ee7b7;
}

.btn-icon.invoice {
    color: #7c3aed;
    border-color: #ddd6fe;
    background: #f5f3ff;
}

.btn-icon.invoice:hover {
    background: #ede9fe;
    border-color: #c4b5fd;
}

.btn-icon.send {
    color: #2563eb;
    border-color: #bfdbfe;
    background: #eff6ff;
}

.btn-icon.send:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}

.btn-icon.receive {
    color: #d97706;
    border-color: #fde68a;
    background: #fffbeb;
}

.btn-icon.receive:hover {
    background: #fef3c7;
    border-color: #fcd34d;
}

.btn-icon.post {
    color: #059669;
    border-color: #a7f3d0;
    background: #ecfdf5;
}

.btn-icon.post:hover {
    background: #d1fae5;
    border-color: #6ee7b7;
}

.btn-icon.approve {
    color: #059669;
    border-color: #a7f3d0;
    background: #ecfdf5;
}

.btn-icon.approve:hover {
    background: #d1fae5;
    border-color: #6ee7b7;
}

.btn-icon.submit {
    color: #0284c7;
    border-color: #bae6fd;
    background: #e0f2fe;
}

.btn-icon.submit:hover {
    background: #bae6fd;
    border-color: #7dd3fc;
}

.btn-icon.convert {
    color: #7c3aed;
    border-color: #ddd6fe;
    background: #f5f3ff;
}

.btn-icon.convert:hover {
    background: #ede9fe;
    border-color: #c4b5fd;
}

/* Table Styles */
.table-container {
    background: white;
    border-radius: 12px;
    border-radius: 12px;
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border: 1px solid #e5e7eb;
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.modern-table th {
    background: #f9fafb;
    padding: 1rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #4b5563;
    border-bottom: 1px solid #e5e7eb;
}

.modern-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.modern-table tr:hover {
    background-color: #f9fafb;
}

.modern-table td.amount {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
}

/* Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-block;
}

.badge-draft {
    background: #f3f4f6;
    color: #374151;
}

.badge-confirmed {
    background: #dbeafe;
    color: #1e40af;
}

.badge-invoiced {
    background: #ede9fe;
    color: #5b21b6;
}

.badge-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.badge-rejected {
    background: #fee2e2;
    color: #991b1b;
}

.badge-posted {
    background: #dcfce7;
    color: #166534;
}

.badge-paid {
    background: #d1fae5;
    color: #065f46;
}

.badge-sent {
    background: #e0f2fe;
    color: #0369a1;
}

.badge-acknowledged {
    background: #ffedd5;
    color: #9a3412;
}

.badge-received {
    background: #dcfce7;
    color: #15803d;
}

.badge-partiallyreceived {
    background: #fef3c7;
    color: #b45309;
}

.badge-closed {
    background: #f3f4f6;
    color: #1f2937;
}

.badge-pending {
    background: #fff7ed;
    color: #c2410c;
}

.badge-approved {
    background: #dcfce7;
    color: #15803d;
}

.badge-converted {
    background: #f3e8ff;
    color: #6b21a8;
}

.badge-autoapproved {
    background: #ccfbf1;
    color: #0f766e;
}

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

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* Stats Cards (for Invoices) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.stat-card .label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.stat-card .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
}

.stat-card .valueHighlight {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4f46e5;
}