/* Fix SPA Flexbox Constraints */
.accounting-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.accounting-view-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    background: #f8fafc;
}

.accounting-header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    height: 64px;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-nav-left h2 {
    font-size: 1.25rem;
    color: #0f172a;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.header-nav-center {
    display: flex;
    gap: 0.5rem;
    height: 100%;
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 1.25rem;
    border: none;
    background: none;
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    height: 100%;
    position: relative;
}

.nav-tab:hover {
    color: #1e293b;
    background: #f1f5f9;
}

.nav-tab.active {
    color: #2563eb;
}

.nav-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: #2563eb;
}

.accounting-content-area {
    flex: 1;
    padding: 2.5rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    overflow-y: auto;
}

/* Dashboard Refinements */
.dashboard-header {
    margin-bottom: 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.financial-funnel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    padding: 1.75rem;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.card-icon-container {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card.primary .card-icon-container {
    background: #eff6ff;
    color: #2563eb;
}

.stat-card.warning .card-icon-container {
    background: #fffbeb;
    color: #d97706;
}

.stat-card.success .card-icon-container {
    background: #f0fdf4;
    color: #16a34a;
}

.stat-card .label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card h3 {
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0.25rem 0;
    color: #0f172a;
}

.card-meta {
    font-size: 0.8rem;
    color: #94a3b8;
    margin: 0;
}

/* Secondary Grid */
.dashboard-secondary-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.card {
    background: white;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.card-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-list li {
    padding: 12px 0;
    border-bottom: 1px solid #f8fafc;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #475569;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-list li:last-child {
    border-bottom: none;
}

.nav-list li:hover {
    color: #2563eb;
}

/* Invoices & Table Styling */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th {
    background: #f8fafc;
    padding: 1rem 1.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 600;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.data-table td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    font-size: 0.9rem;
}

/* Loading & Error States */
.v-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    gap: 1rem;
    color: #64748b;
}

.v-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    color: #94a3b8;
}

/* Manager Tabs */
.manager-tabs {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid #e2e8f0;
}

.m-tab {
    padding: 12px 4px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #64748b;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.m-tab:hover {
    color: #1e293b;
}

.m-tab.active {
    color: #2563eb;
    border-color: #2563eb;
}

/* Matching Grid Layout */
.matching-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

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

.matching-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.vendor-info {
    display: flex;
    flex-direction: column;
}

.vendor-info strong {
    font-size: 1rem;
    color: #1e293b;
}

.vendor-info span {
    font-size: 0.8rem;
    color: #64748b;
}

.matching-visuals {
    display: flex;
    gap: 4px;
}

.matching-step {
    width: 32px;
    height: 24px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-transform: uppercase;
}

.matching-step.primary {
    background: #2563eb;
}

.matching-step.success {
    background: #16a34a;
}

.matching-step.warning {
    background: #f59e0b;
}

.matching-step.gray {
    background: #e2e8f0;
    color: #94a3b8;
}

.card-mid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 1rem 0;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
}

.amount-info,
.date-info {
    display: flex;
    flex-direction: column;
}

.card-mid .label {
    font-size: 0.7rem;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 600;
}

.card-mid .value {
    font-weight: 700;
    color: #1e293b;
}

.card-footer .btn-full {
    width: 100%;
}

.btn.disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
    border-color: #e2e8f0;
}

/* Invoice Print & Preview Styles */
.invoice-preview-modal {
    max-width: 900px;
    width: 95%;
    padding: 0;
    overflow: hidden;
    background: white;
}

.invoice-container {
    background: white;
    padding: 3rem;
    color: #1a202c;
    font-size: 0.95rem;
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 3rem;
    border-bottom: 2px solid #edf2f7;
    padding-bottom: 1.5rem;
}

.company-brand h1 {
    font-size: 2rem;
    font-weight: 800;
    color: #2d3748;
    margin: 0;
}

.invoice-id {
    font-size: 1.1rem;
    color: #718096;
    font-weight: 600;
}

.invoice-meta {
    text-align: right;
}

.meta-item {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 4px;
}

.meta-item .label {
    color: #a0aec0;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.invoice-parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.section-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #a0aec0;
    font-weight: 700;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid #edf2f7;
}

.invoice-items-table {
    width: 100%;
    margin-bottom: 3rem;
    border-top: 2px solid #2d3748;
}

.invoice-items-table th {
    padding: 12px 0;
    border-bottom: 1px solid #edf2f7;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #718096;
}

.invoice-items-table td {
    padding: 16px 0;
    border-bottom: 1px solid #f7fafc;
}

.invoice-footer {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 4rem;
}

.totals-area {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
}

.grand-total {
    border-top: 2px solid #2d3748;
    padding-top: 12px;
    font-size: 1.25rem;
    font-weight: 800;
    color: #2d3748;
}

@media print {
    .no-print {
        display: none !important;
    }

    .v-modal-overlay {
        background: white !important;
        position: absolute;
        padding: 0;
    }

    .invoice-preview-modal {
        box-shadow: none !important;
        border: none !important;
        margin: 0;
        width: 100%;
        max-width: none;
    }
}

/* Status Badges */
.badge {
    padding: 6px 12px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-draft {
    background: #f1f5f9;
    color: #64748b;
}

.badge-under_review {
    background: #fef9c3;
    color: #a16207;
}

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

.badge-approved {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-posted {
    background: #ede9fe;
    color: #6d28d9;
}

.badge-paid {
    background: #f0fdf4;
    color: #16a34a;
}

.badge-void {
    background: #fee2e2;
    color: #ef4444;
}

/* Matching UI Enhancements */
.btn-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.invoice-preview-modal {
    max-width: 900px !important;
}

.v-modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    background: #f8fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0 0 12px 12px;
}

.v-modal-footer .footer-note {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: #475569;
}

.invoice-items-table th {
    background: #f1f5f9;
    color: #475569;
    font-weight: 600;
}

.invoice-items-table td {
    border-bottom: 1px solid #f1f5f9;
}

.text-success {
    color: #059669 !important;
}

.matching-visuals {
    display: flex;
    gap: 4px;
}

.matching-step {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    background: #e2e8f0;
    color: #64748b;
}

.matching-step.primary {
    background: var(--primary-color);
    color: white;
}

.matching-step.success {
    background: #dcfce7;
    color: #166534;
}

.matching-step.warning {
    background: #fef9c3;
    color: #854d0e;
}

@media print {
    .printable-area {
        padding: 0 !important;
    }
}