/* ============================================
   Finance Cards Section — Premium Design
   ============================================ */

/* --- Section Container --- */
.finance-section {
    margin: 24px 0;
    animation: finFadeInUp 0.6s ease-out;
}

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

/* --- Section Header --- */
.finance-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid rgba(255, 107, 107, 0.18);
}

.finance-header-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.15rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.finance-header-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3436;
    margin: 0;
    letter-spacing: -0.02em;
}

.finance-header-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, rgba(255,107,107,0.3), transparent);
    border-radius: 1px;
}

/* --- Tab Navigation --- */
.finance-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 14px;
    border: 1px solid rgba(255, 107, 107, 0.1);
}

.finance-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    background: transparent;
    color: #636e72;
    font-family: 'Kanit', sans-serif;
    font-size: 0.82rem;
    font-weight: 400;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.finance-tab-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    opacity: 0;
    border-radius: 10px;
    transition: opacity 0.3s ease;
}

.finance-tab-btn:hover {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.08);
}

.finance-tab-btn.active {
    color: #fff;
    font-weight: 500;
    box-shadow: 0 4px 14px rgba(255, 107, 107, 0.35);
}

.finance-tab-btn.active::before {
    opacity: 1;
}

.finance-tab-btn i,
.finance-tab-btn span {
    position: relative;
    z-index: 1;
}

.finance-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(255, 107, 107, 0.12);
    color: #ff6b6b;
    transition: all 0.3s ease;
}

.finance-tab-btn.active .finance-tab-count {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* --- Tab Content Panels --- */
.finance-tab-panel {
    display: none;
    animation: finPanelIn 0.35s ease-out;
}

.finance-tab-panel.active {
    display: block;
}

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

/* --- Search Bar --- */
.finance-search-bar {
    position: relative;
    margin-bottom: 16px;
}

.finance-search-bar input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 1px solid rgba(255, 107, 107, 0.15);
    border-radius: 12px;
    font-family: 'Kanit', sans-serif;
    font-size: 0.88rem;
    color: #2d3436;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(6px);
    transition: all 0.3s ease;
    outline: none;
}

.finance-search-bar input:focus {
    border-color: #ff6b6b;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.12);
}

.finance-search-bar input::placeholder {
    color: #b2bec3;
}

.finance-search-bar .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #b2bec3;
    font-size: 0.9rem;
    pointer-events: none;
    transition: color 0.3s ease;
}

.finance-search-bar input:focus ~ .search-icon {
    color: #ff6b6b;
}

/* --- Card Grid --- */
.finance-card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

/* --- Document Card --- */
.finance-doc-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 107, 107, 0.08);
    border-radius: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
    position: relative;
    overflow: hidden;
}

.finance-doc-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #ff6b6b, #ee5a24);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 3px 0 0 3px;
}

.finance-doc-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 107, 107, 0.12);
    border-color: rgba(255, 107, 107, 0.2);
}

.finance-doc-card:hover::before {
    opacity: 1;
}

/* File type icon */
.finance-doc-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.3rem;
    transition: transform 0.3s ease;
}

.finance-doc-card:hover .finance-doc-icon {
    transform: scale(1.08);
}

.finance-doc-icon.type-pdf {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.finance-doc-icon.type-word {
    background: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
}

.finance-doc-icon.type-excel {
    background: rgba(25, 135, 84, 0.1);
    color: #198754;
}

.finance-doc-icon.type-image {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.finance-doc-icon.type-default {
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
}

/* Card body */
.finance-doc-body {
    flex: 1;
    min-width: 0;
}

.finance-doc-title {
    font-size: 0.88rem;
    font-weight: 500;
    color: #2d3436;
    margin: 0 0 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.finance-doc-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.finance-doc-date {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: #b2bec3;
}

.finance-doc-date i {
    font-size: 0.7rem;
}

.finance-doc-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.finance-doc-type-badge.badge-pdf {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.finance-doc-type-badge.badge-word {
    background: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
}

.finance-doc-type-badge.badge-excel {
    background: rgba(25, 135, 84, 0.1);
    color: #198754;
}

.finance-doc-type-badge.badge-image {
    background: rgba(255, 193, 7, 0.1);
    color: #d4a005;
}

.finance-doc-type-badge.badge-default {
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
}

/* Card action buttons */
.finance-doc-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.finance-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.88rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.finance-btn-preview {
    background: rgba(99, 110, 114, 0.08);
    color: #636e72;
}

.finance-btn-preview:hover {
    background: rgba(99, 110, 114, 0.16);
    color: #2d3436;
    transform: scale(1.08);
}

.finance-btn-download {
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
}

.finance-btn-download:hover {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: #fff;
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

/* --- Empty State --- */
.finance-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #b2bec3;
}

.finance-empty-state i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    display: block;
    opacity: 0.4;
}

.finance-empty-state p {
    font-size: 0.9rem;
    margin: 0;
}

/* --- Pagination --- */
.finance-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.finance-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border: 1px solid rgba(255, 107, 107, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.7);
    color: #636e72;
    font-family: 'Kanit', sans-serif;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.25s ease;
}

.finance-page-btn:hover {
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.finance-page-btn.active {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 3px 10px rgba(255, 107, 107, 0.3);
}

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

.finance-page-info {
    font-size: 0.78rem;
    color: #b2bec3;
    margin-left: 8px;
}

/* --- View All Link --- */
.finance-view-all {
    display: flex;
    justify-content: center;
    margin-top: 18px;
}

.finance-view-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: #fff;
    font-family: 'Kanit', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(255, 107, 107, 0.25);
}

.finance-view-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.35);
    color: #fff;
}

.finance-view-all-btn i {
    transition: transform 0.3s ease;
}

.finance-view-all-btn:hover i {
    transform: translateX(3px);
}

/* --- Responsive --- */
@media screen and (max-width: 768px) {
    .finance-tabs {
        gap: 4px;
        padding: 3px;
    }

    .finance-tab-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .finance-tab-btn .tab-label-text {
        display: none;
    }

    .finance-tab-btn .tab-label-short {
        display: inline;
    }

    .finance-doc-card {
        padding: 12px;
        gap: 10px;
    }

    .finance-doc-icon {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
    }

    .finance-doc-title {
        font-size: 0.82rem;
    }

    .finance-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .finance-section-header {
        gap: 8px;
    }

    .finance-header-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .finance-header-title {
        font-size: 1.05rem;
    }
}

@media screen and (max-width: 480px) {
    .finance-doc-actions {
        flex-direction: column;
        gap: 4px;
    }

    .finance-doc-card {
        flex-wrap: wrap;
    }
}

/* Short labels hidden by default, shown on mobile */
.tab-label-short {
    display: none;
}
