/* Variables */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #3498db;
    --success: #27ae60;
    --warning: #f39c12;
    --error: #e74c3c;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --border: #dfe6e9;
    --background: #f8f9fa;
    --surface: #ffffff;
}

/* Table Container with Scroll */
.table-container {
    max-height: calc(100vh - 400px);
    overflow-y: auto;
    overflow-x: auto;
}

.table-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: var(--background);
}

.table-container::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* State Badge - Smaller size */
.state-badge {
    padding: 2px 6px !important;
    font-size: 0.65rem !important;
    letter-spacing: 0.3px !important;
}

/* Bulk Actions Bar */
.bulk-actions-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 2px;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.bulk-actions-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.selected-count {
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding-left: 20px;
    border-left: 1px solid var(--border);
}

.btn-bulk-approve {
    padding: 10px 20px;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 2px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-bulk-approve:hover:not(:disabled) {
    background: #229954;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(39, 174, 96, 0.2);
}

.btn-bulk-approve:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Budget Info Section */
.budget-info-section {
    background: linear-gradient(135deg, #ecf0f1 0%, #bdc3c7 100%);
    border-radius: 2px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.budget-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.budget-info-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.budget-period {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--primary-color);
    color: white;
    padding: 6px 16px;
    border-radius: 2px;
}

.budget-info-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.budget-info-stat {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.budget-info-stat .stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.budget-info-stat .stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.budget-info-stat.spent .stat-value {
    color: var(--warning);
}

.budget-info-stat.available .stat-value {
    color: var(--success);
}

.budget-progress-bar {
    height: 10px;
    background: white;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.budget-progress-fill {
    height: 100%;
    background: var(--success);
    transition: width 0.5s ease;
    border-radius: 5px;
}

.budget-progress-fill.warning {
    background: var(--warning);
}

.budget-progress-fill.danger {
    background: var(--error);
}

/* Stats Section */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 2px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Orders List */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.order-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 2px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.order-card.selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(44, 62, 80, 0.1);
}

.order-card-header {
    padding: 20px;
    background: var(--background);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.order-select {
    display: flex;
    align-items: center;
}

.order-select input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.order-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.order-id {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
}

.order-meta {
    display: flex;
    gap: 16px;
    font-size: 0.813rem;
    color: var(--text-secondary);
}

.order-total {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--success);
}

.order-card-body {
    padding: 0;
}

/* Products Table */
.products-table {
    width: 100%;
    border-collapse: collapse;
}

.products-table thead {
    background: var(--background);
}

.products-table th {
    padding: 12px 20px;
    text-align: left;
    font-size: 0.813rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.products-table tbody tr {
    border-bottom: 1px solid var(--border);
}

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

.products-table td {
    padding: 16px 20px;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.product-code {
    font-weight: 600;
    color: var(--primary-color);
}

.product-name {
    color: var(--text-primary);
}

.product-quantity,
.product-teeth {
    text-align: center;
}

.product-price,
.product-subtotal {
    text-align: right;
    font-weight: 600;
}

.order-card-footer {
    padding: 20px;
    background: var(--background);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
}

.btn-approve {
    padding: 12px 24px;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 2px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-approve:hover {
    background: #229954;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(39, 174, 96, 0.2);
}

.btn-approve svg {
    width: 16px;
    height: 16px;
}

/* No Orders */
.no-orders {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 60px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 2px;
}

.no-orders svg {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    color: var(--text-secondary);
    opacity: 0.5;
}

.no-orders h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.no-orders p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Loading */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .budget-info-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .budget-info-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .bulk-actions-bar {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }

    .bulk-actions-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .selected-count {
        padding-left: 0;
        border-left: none;
    }

    .btn-bulk-approve {
        width: 100%;
    }

    .stats-section {
        grid-template-columns: 1fr;
    }

    .order-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .order-meta {
        flex-direction: column;
        gap: 4px;
    }

    .products-table {
        font-size: 0.75rem;
    }

    .products-table th,
    .products-table td {
        padding: 8px 12px;
    }

    .products-table th:nth-child(3),
    .products-table td:nth-child(3) {
        display: none;
    }
}

@media (max-width: 480px) {
    .order-card-header {
        padding: 16px;
    }

    .order-card-body {
        overflow-x: auto;
    }

    .products-table {
        min-width: 500px;
    }

    .order-card-footer {
        padding: 16px;
    }

    .btn-approve {
        width: 100%;
        justify-content: center;
    }
}

