/**
 * Finance Module Styles
 *
 * Includes: loading skeletons, past-due badges, inline previews
 */

/* ============================================================
   Hide number input spinners (prevents accidental value changes
   on monetary/quantity fields via scroll wheel or arrow clicks)
   ============================================================ */

input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}

/* ============================================================
   Loading Skeleton Animation
   ============================================================ */

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-line {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

/* ============================================================
   Past Due Badge Enhancements
   ============================================================ */

.mts-badge.mts-badge-error {
    animation: pulse-error 2s infinite;
}

@keyframes pulse-error {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* ============================================================
   Inline Preview Styles
   ============================================================ */

.finance-inline-preview {
    display: inline-block;
    padding: 4px 12px;
    margin-left: 12px;
    background: var(--mts-gray-100, #f3f4f6);
    border: 1px solid var(--mts-gray-300, #d1d5db);
    border-radius: 6px;
    font-size: 13px;
    color: var(--mts-gray-700, #374151);
    font-weight: 500;
}

.finance-inline-preview-label {
    font-size: 11px;
    color: var(--mts-gray-500, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 6px;
}

.finance-inline-preview-value {
    color: var(--mts-primary-color, #3b82f6);
    font-weight: 600;
}

.finance-inline-preview.tax-exempt {
    background: var(--mts-success-light, #d1fae5);
    border-color: var(--mts-success, #10b981);
    color: var(--mts-success-dark, #065f46);
}

/* ============================================================
   Error State Styles
   ============================================================ */

.finance-error-state {
    text-align: center;
    padding: var(--spacing-xl, 24px);
}

.finance-error-state h4 {
    margin: 0 0 8px;
    color: var(--mts-error, #ef4444);
}

.finance-error-state p {
    margin: 0;
    color: var(--mts-gray-600, #4b5563);
    font-size: 14px;
}

.finance-error-state button {
    margin-top: 16px;
}

/* ============================================================
   Form Section Enhancements
   ============================================================ */

.finance-form-section {
    margin-bottom: var(--spacing-lg, 20px);
    padding: var(--spacing-md, 16px);
    background: var(--mts-gray-50, #f9fafb);
    border-radius: 8px;
    border-left: 4px solid var(--mts-primary-color, #3b82f6);
}

.finance-form-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--mts-gray-900, #111827);
    margin-bottom: var(--spacing-sm, 12px);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================================
   Button Loading States
   ============================================================ */

.mts-btn.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.mts-btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: button-loading-spinner 0.6s linear infinite;
}

@keyframes button-loading-spinner {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ============================================================
   Badge Improvements
   ============================================================ */

.mts-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
}

.mts-badge-gray {
    background: #e5e7eb;
    color: #374151;
}

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

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

.mts-badge-warning {
    background: #fef3c7;
    color: #92400e;
}

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

/* ============================================================
   Tooltip Enhancements
   ============================================================ */

.finance-tooltip {
    position: relative;
    display: inline-block;
}

.finance-tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
    line-height: 1.4;
}

.finance-tooltip:hover .finance-tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* ============================================================
   Responsive Adjustments
   ============================================================ */

@media (max-width: 768px) {
    .finance-inline-preview {
        display: block;
        margin-left: 0;
        margin-top: 8px;
    }

    .mts-badge {
        font-size: 11px;
        padding: 3px 8px;
    }
}

/* ============================================================
   Project Finance Command Center - Redesigned UI
   ============================================================ */

/* Financial Health Cards Grid */
.finance-health-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

@media (max-width: 1024px) {
    .finance-health-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .finance-health-grid {
        grid-template-columns: 1fr;
    }
}

.finance-health-card {
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    border: 1px solid var(--mts-gray-200, #e5e7eb);
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}

.finance-health-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.finance-health-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.finance-health-card.revenue::before { background: var(--mts-success, #10b981); }
.finance-health-card.costs::before { background: var(--mts-warning, #f59e0b); }
.finance-health-card.profit::before { background: var(--mts-primary, #3b82f6); }
.finance-health-card.margin::before { background: var(--mts-purple, #8b5cf6); }

.finance-health-card.profit.negative::before { background: var(--mts-error, #ef4444); }

.finance-health-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--mts-gray-500, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.finance-health-label .icon {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

.finance-health-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--mts-gray-900, #111827);
    line-height: 1.1;
    margin-bottom: 4px;
}

.finance-health-card.profit.negative .finance-health-value {
    color: var(--mts-error, #ef4444);
}

.finance-health-card.profit.positive .finance-health-value {
    color: var(--mts-success, #10b981);
}

.finance-health-subtitle {
    font-size: 12px;
    color: var(--mts-gray-500, #6b7280);
}

.finance-health-tooltip {
    position: absolute;
    top: 12px;
    right: 12px;
    cursor: help;
    color: var(--mts-gray-400, #9ca3af);
    transition: color 0.2s;
}

.finance-health-tooltip:hover {
    color: var(--mts-gray-600, #4b5563);
}

/* Progress Indicators Section */
.finance-progress-section {
    background: var(--mts-gray-50, #f9fafb);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--mts-gray-200, #e5e7eb);
}

.finance-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.finance-progress-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--mts-gray-700, #374151);
}

.finance-progress-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

@media (max-width: 768px) {
    .finance-progress-grid {
        grid-template-columns: 1fr;
    }
}

.finance-progress-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.finance-progress-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.finance-progress-label {
    font-size: 13px;
    color: var(--mts-gray-600, #4b5563);
}

.finance-progress-values {
    font-size: 13px;
    font-weight: 500;
    color: var(--mts-gray-700, #374151);
}

.finance-progress-bar {
    height: 8px;
    background: var(--mts-gray-200, #e5e7eb);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.finance-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.finance-progress-fill.invoiced { background: linear-gradient(90deg, #10b981, #34d399); }
.finance-progress-fill.costs { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.finance-progress-fill.over-budget { background: linear-gradient(90deg, #ef4444, #f87171); }

/* Action Center */
.finance-action-center {
    background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
    border: 1px solid #fde047;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.finance-action-center.empty {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #86efac;
}

.finance-action-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.finance-action-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.finance-action-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--mts-gray-800, #1f2937);
}

.finance-action-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.finance-action-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    padding: 14px 16px;
    border-radius: 8px;
    border: 1px solid var(--mts-gray-200, #e5e7eb);
    gap: 16px;
}

.finance-action-item:hover {
    border-color: var(--mts-primary, #3b82f6);
}

.finance-action-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.finance-action-badge {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.finance-action-badge.invoice { background: #dbeafe; }
.finance-action-badge.po { background: #fef3c7; }
.finance-action-badge.bill { background: #fee2e2; }
.finance-action-badge.payment { background: #d1fae5; }
.finance-action-badge.review { background: #f3e8ff; }

.finance-action-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.finance-action-message {
    font-size: 14px;
    color: var(--mts-gray-700, #374151);
    font-weight: 500;
}

.finance-action-detail {
    font-size: 12px;
    color: var(--mts-gray-500, #6b7280);
}

.finance-action-btn {
    padding: 8px 16px;
    background: var(--mts-primary, #3b82f6);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.finance-action-btn:hover {
    background: var(--mts-primary-dark, #2563eb);
    transform: translateY(-1px);
}

.finance-action-btn.secondary {
    background: white;
    color: var(--mts-primary, #3b82f6);
    border: 1px solid var(--mts-primary, #3b82f6);
}

.finance-action-btn.secondary:hover {
    background: var(--mts-primary, #3b82f6);
    color: white;
}

.finance-all-clear {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
}

.finance-all-clear-icon {
    font-size: 24px;
}

.finance-all-clear-text {
    font-size: 14px;
    color: var(--mts-gray-600, #4b5563);
}

/* Document Tabs - Enhanced */
.finance-tabs-wrapper {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--mts-gray-200, #e5e7eb);
    overflow: hidden;
}

.finance-tabs-header {
    display: flex;
    border-bottom: 1px solid var(--mts-gray-200, #e5e7eb);
    background: var(--mts-gray-50, #f9fafb);
    overflow-x: auto;
}

.finance-tab-btn-enhanced {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    background: transparent;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--mts-gray-600, #4b5563);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.finance-tab-btn-enhanced:hover:not(.active) {
    color: var(--mts-gray-800, #1f2937);
    background: var(--mts-gray-100, #f3f4f6);
}
/* Clicked buttons keep :focus in most browsers, which was leaving the
   hover colours latched on after a click. Suppress the default focus
   ring and the hover-style focus latch so only .active drives visual
   state. Keyboard users still get :focus-visible for accessibility. */
.finance-tab-btn-enhanced:focus { outline: none; }
.finance-tab-btn-enhanced:focus:not(:focus-visible):not(.active) { background: transparent; color: var(--mts-gray-600, #4b5563); }
.finance-tab-btn-enhanced:focus-visible { outline: 2px solid var(--theme-primary, #CC5500); outline-offset: -2px; }

.finance-tab-btn-enhanced.active {
    color: var(--mts-primary, #3b82f6);
    border-bottom-color: var(--mts-primary, #3b82f6);
    background: white;
}

.finance-tab-btn-enhanced.highlight {
    background: #eff6ff;
}

.finance-tab-btn-enhanced.highlight.active {
    background: white;
}

.finance-tab-total {
    font-size: 12px;
    padding: 2px 8px;
    background: var(--mts-gray-200, #e5e7eb);
    border-radius: 10px;
    color: var(--mts-gray-600, #4b5563);
}

.finance-tab-btn-enhanced.active .finance-tab-total {
    background: var(--mts-primary, #3b82f6);
    color: white;
}

.finance-tabs-body {
    padding: 20px;
}

/* Enhanced Table Styles */
.finance-table {
    width: 100%;
    border-collapse: collapse;
}

.finance-table thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--mts-gray-500, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--mts-gray-200, #e5e7eb);
    background: var(--mts-gray-50, #f9fafb);
}

.finance-table tbody td {
    padding: 14px 16px;
    font-size: 14px;
    color: var(--mts-gray-700, #374151);
    border-bottom: 1px solid var(--mts-gray-100, #f3f4f6);
    vertical-align: middle;
}

.finance-table tbody tr:hover {
    background: var(--mts-gray-50, #f9fafb);
}

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

.finance-table-doc-number {
    font-weight: 600;
    color: var(--mts-gray-900, #111827);
}

.finance-table-amount {
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

.finance-table-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.finance-table-actions-sticky {
    position: sticky;
    right: 0;
    background: white;
    padding-left: 24px;
}

.finance-table tbody tr:hover .finance-table-actions-sticky {
    background: var(--mts-gray-50, #f9fafb);
}

/* Status badges - Enhanced */
.finance-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.finance-status-badge.draft {
    background: var(--mts-gray-100, #f3f4f6);
    color: var(--mts-gray-600, #4b5563);
}

.finance-status-badge.approved,
.finance-status-badge.sent,
.finance-status-badge.issued {
    background: #dbeafe;
    color: #1e40af;
}

.finance-status-badge.outstanding {
    background: #fef3c7;
    color: #92400e;
}

.finance-status-badge.paid,
.finance-status-badge.closed {
    background: #d1fae5;
    color: #065f46;
}

.finance-status-badge.overdue,
.finance-status-badge.voided {
    background: #fee2e2;
    color: #991b1b;
}

.finance-status-badge.partial {
    background: #fef3c7;
    color: #92400e;
}

.finance-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* Empty state */
.finance-empty-state {
    text-align: center;
    padding: 48px 24px;
}

.finance-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.finance-empty-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--mts-gray-700, #374151);
    margin-bottom: 8px;
}

.finance-empty-desc {
    font-size: 14px;
    color: var(--mts-gray-500, #6b7280);
    margin-bottom: 20px;
}

/* Row action buttons */
.finance-row-action {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid;
}

.finance-row-action.view {
    background: white;
    border-color: var(--mts-gray-300, #d1d5db);
    color: var(--mts-gray-700, #374151);
}

.finance-row-action.view:hover {
    background: var(--mts-gray-100, #f3f4f6);
}

.finance-row-action.primary {
    background: var(--mts-primary, #3b82f6);
    border-color: var(--mts-primary, #3b82f6);
    color: white;
}

.finance-row-action.primary:hover {
    background: var(--mts-primary-dark, #2563eb);
}

.finance-row-action.secondary {
    background: white;
    border-color: var(--mts-primary, #3b82f6);
    color: var(--mts-primary, #3b82f6);
}

.finance-row-action.secondary:hover {
    background: var(--mts-primary, #3b82f6);
    color: white;
}

/* Labor breakdown mini card */
.finance-labor-mini {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 12px 16px;
    background: var(--mts-gray-50, #f9fafb);
    border-radius: 8px;
    margin-top: 16px;
}

.finance-labor-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.finance-labor-icon {
    font-size: 14px;
}

.finance-labor-label {
    font-size: 12px;
    color: var(--mts-gray-500, #6b7280);
}

.finance-labor-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--mts-gray-800, #1f2937);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .finance-action-item {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .finance-action-btn {
        width: 100%;
        text-align: center;
    }

    .finance-table {
        display: block;
        overflow-x: auto;
    }

    .finance-labor-mini {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}

/* ============================================================
   Animations and Transitions
   ============================================================ */

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseGreen {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
}

.finance-health-card {
    animation: slideInUp 0.3s ease-out;
}

.finance-health-card:nth-child(2) { animation-delay: 0.05s; }
.finance-health-card:nth-child(3) { animation-delay: 0.1s; }
.finance-health-card:nth-child(4) { animation-delay: 0.15s; }

.finance-action-center.empty {
    animation: pulseGreen 2s ease-in-out;
}

.finance-progress-fill {
    animation: progressGrow 0.8s ease-out;
}

@keyframes progressGrow {
    from {
        width: 0;
    }
}

/* Tooltip - use data-tooltip instead of title to avoid double tooltip */
.finance-health-tooltip {
    position: relative;
}

.finance-health-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: var(--mts-gray-800, #1f2937);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 100;
    pointer-events: none;
}

.finance-health-tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Value highlighting */
.finance-health-value.highlight-positive {
    color: var(--mts-success, #10b981);
}

.finance-health-value.highlight-negative {
    color: var(--mts-error, #ef4444);
}

/* Compact mode for smaller screens */
@media (max-width: 480px) {
    .finance-health-value {
        font-size: 22px;
    }

    .finance-health-card {
        padding: 12px 16px;
    }

    .finance-tabs-header {
        gap: 0;
    }

    .finance-tab-btn-enhanced {
        padding: 12px 14px;
        font-size: 13px;
    }

    .finance-tab-total {
        display: none;
    }
}

/* Print styles */
@media print {
    .finance-action-center,
    .finance-row-action,
    .finance-action-btn {
        display: none !important;
    }

    .finance-health-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* ============================================================
   Finance Command Center - Main Page Responsive Styles
   ============================================================ */

/* KPI Cards responsive */
@media (max-width: 1200px) {
    #view-finance .finance-health-grid,
    #finance-view-overview > div:first-child {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    #view-finance .finance-health-grid,
    #finance-view-overview > div:first-child {
        grid-template-columns: 1fr !important;
    }

    /* Charts row stacks */
    #finance-view-overview > div:nth-child(2) {
        grid-template-columns: 1fr !important;
    }

    /* Aging + Action center row stacks */
    #finance-view-overview > div:nth-child(3) {
        grid-template-columns: 1fr !important;
    }

    /* Breakdown cards stack */
    #finance-view-overview > div:nth-child(4) {
        grid-template-columns: 1fr !important;
    }

    /* Tab navigation scrollable */
    .finance-tabs-header {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .finance-tab-btn-enhanced {
        flex-shrink: 0;
    }
}

/* Chart range buttons */
.fin-chart-range {
    padding: 4px 12px;
    font-size: 12px;
    border: 1px solid #e5e7eb;
    background: white;
    color: #6b7280;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fin-chart-range:hover {
    background: #f3f4f6;
    color: #374151;
}

.fin-chart-range.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.fin-chart-range.active:hover {
    background: #2563eb;
}

/* Finance Tab Attention Badge */
.finance-tab-attention {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    display: inline-block;
    margin-left: 6px;
    animation: attention-pulse 2s ease-in-out infinite;
    position: relative;
}

.finance-tab-attention::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.3);
    animation: attention-ring 2s ease-in-out infinite;
}

@keyframes attention-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(0.9);
    }
}

@keyframes attention-ring {
    0%, 100% {
        transform: scale(1);
        opacity: 0.4;
    }
    50% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Warning level (yellow) for less urgent items */
.finance-tab-attention.warning {
    background: #f59e0b;
}

.finance-tab-attention.warning::after {
    background: rgba(245, 158, 11, 0.3);
}

/* Finance Filter Buttons */
.finance-filter-btn {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #e5e7eb;
    background: white;
    color: #6b7280;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.finance-filter-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
}

.finance-filter-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.finance-filter-btn.active:hover {
    background: #2563eb;
}

/* Attention filter special styling */
.finance-filter-btn[data-filter="attention"] {
    border-color: #fde047;
    background: #fefce8;
    color: #854d0e;
}

.finance-filter-btn[data-filter="attention"]:hover {
    background: #fef9c3;
}

.finance-filter-btn[data-filter="attention"].active {
    background: #eab308;
    border-color: #eab308;
    color: white;
}

/* Donut chart animation */
#finance-view-overview svg circle {
    transition: stroke-dasharray 0.5s ease, stroke-dashoffset 0.5s ease;
}

/* Aging bar animation */
#agingChart > div > div:nth-child(2) > div {
    transition: width 0.5s ease;
}
