/* ═══════════════════════════════════════════════
   TunUp HRIS — Expense Management Styles
   ═══════════════════════════════════════════════ */

/* ─── Page Layout ─── */
.expense-page-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.expense-page-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

/* ─── Action Bar ─── */
.expense-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.btn-new-expense {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.btn-new-expense:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
}

/* ─── Status Filter ─── */
.status-filter {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
}

.filter-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-pill {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1.5px solid #e2e8f0;
    background: white;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-pill:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.filter-pill.active {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* ─── Table ─── */
.expense-table-container {
    background: white;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

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

.expense-table thead {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
}

.expense-table th {
    padding: 14px 16px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left;
    border-bottom: 2px solid #e2e8f0;
}

.expense-table td {
    padding: 14px 16px;
    font-size: 0.875rem;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.expense-row {
    transition: background-color 0.2s ease;
}

.expense-row:hover {
    background-color: #f8fafc;
}

.expense-row.row-processing {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    opacity: 0.85;
    pointer-events: none;
}

/* ─── Cell Styles ─── */
.cell-id {
    font-weight: 600;
    color: #94a3b8;
    font-size: 0.8rem;
    width: 50px;
}

.expense-id-tag {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 6px;
}

.employee-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.employee-name {
    font-weight: 600;
    color: #1e293b;
}

.employee-email {
    font-size: 0.75rem;
    color: #94a3b8;
}

.more-items {
    display: inline-block;
    margin-left: 4px;
    padding: 0 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    background: #f1f5f9;
    color: #64748b;
}

.amount-value {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: #1e293b;
}

.amount-currency {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-left: 4px;
}

/* ─── Action Buttons ─── */
.action-buttons {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.btn-action-view,
.btn-action-edit,
.btn-action-cancel,
.btn-action-resubmit {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-action-view {
    background: #f1f5f9;
    color: #475569;
}

.btn-action-view:hover {
    background: #e2e8f0;
}

.btn-action-edit {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.btn-action-edit:hover {
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
    transform: translateY(-1px);
}

.btn-action-cancel {
    background: #fee2e2;
    color: #991b1b;
}

.btn-action-cancel:hover {
    background: #fecaca;
}

.btn-action-resubmit {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.btn-action-resubmit:hover {
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

.btn-approve,
.btn-reject,
.btn-receipts,
.btn-settle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-approve {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
}

.btn-approve:hover {
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4);
    transform: translateY(-1px);
}

.btn-reject {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.btn-reject:hover {
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    transform: translateY(-1px);
}

.btn-receipts {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

.btn-receipts:hover {
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
    transform: translateY(-1px);
}

.btn-settle {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    color: white;
}

.btn-settle:hover {
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.4);
    transform: translateY(-1px);
}

.processing-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #d97706;
    font-weight: 500;
}

/* ─── Empty State ─── */
.expense-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 16px;
    border: 2px dashed #e2e8f0;
}

.empty-icon {
    margin-bottom: 16px;
    opacity: 0.6;
}

.empty-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 8px;
}

.empty-subtitle {
    font-size: 0.9rem;
    color: #94a3b8;
    max-width: 400px;
    margin: 0 auto;
}

/* ─── Loading Card ─── */
.expense-loading-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 20px;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 1px solid #bae6fd;
    border-radius: 12px;
    color: #0369a1;
    font-weight: 500;
    font-size: 0.9rem;
}

/* ─── Form Modal ─── */
.form-modal {
    background: white;
    border-radius: 16px;
    width: 92%;
    max-width: 640px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.3s ease;
    display: flex;
    flex-direction: column;
}

.form-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
}

.form-modal-header h5 {
    margin: 0;
    font-weight: 700;
    color: #1e293b;
    font-size: 1.1rem;
}

.form-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.form-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    background: #f8fafc;
}

/* ─── Line Item Cards ─── */
.line-items-section {
    margin-top: 16px;
}

.btn-add-line {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1.5px dashed #3b82f6;
    background: transparent;
    color: #3b82f6;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-add-line:hover {
    background: #eff6ff;
}

.line-item-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
    background: #fafbfc;
    transition: border-color 0.2s;
}

.line-item-card:hover {
    border-color: #cbd5e1;
}

.line-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.line-item-num {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.btn-remove-line {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: #94a3b8;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.2s;
}

.btn-remove-line:hover {
    color: #ef4444;
}

.line-item-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.field-row {
    display: flex;
    gap: 12px;
}

.field-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.field-group label {
    font-size: 0.73rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.field-sm {
    flex: 0 0 100px;
}

/* ─── Reject Modal (shared by all dashboards) ─── */
.reject-modal {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.3s ease;
}

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

.reject-modal-header h5 {
    margin: 0;
    font-weight: 700;
    color: #991b1b;
}

.reject-modal-body {
    padding: 20px;
}

.reject-modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ─── Toast ─── */
.expense-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    z-index: 2000;
    animation: slideUp 0.3s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.toast-success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.toast-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.toast-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* ─── Animations ─── */
@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ─── Modal Overlay (reusable) ─── */
.expense-detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.detail-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #94a3b8;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.2s;
}

.detail-modal-close:hover {
    color: #475569;
}

/* ─── Column widths ─── */
.col-id { width: 50px; }
.col-exp-id { width: 160px; }
.col-employee { width: 200px; }
.col-date { width: 110px; }
.col-category { width: 150px; }
.col-amount { width: 120px; }
.col-status { width: 150px; }
.col-actions { width: auto; }
