/* ==============================
   PUNNAGAI GOLD LOAN - DASHBOARD REFINED
   (Enterprise-grade UI)
   ============================== */

/* --- Page Structure --- */
.dashboard-wrapper {
    animation: fadeInPage 0.4s ease-out;
}

@keyframes fadeInPage {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dash-page-header {
    margin-bottom: 0px;
    padding-top: 8px;
}

.dash-page-header h3 {
    font-size: 32px;
    /* Prominent size */
    font-weight: 900;
    /* Extra bold */
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.04em;
    /* Tight tracking for modern feel */
}

.dash-page-header .subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* --- Content Card --- */
.loan-list-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.list-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: #fcfcfd;
}

/* --- Filter Bar (Segmented Control) --- */
.filter-bar-segmented {
    display: inline-flex;
    background: #f1f5f9;
    padding: 5px;
    border-radius: 14px;
    gap: 6px;
}

.segment-item {
    padding: 10px 24px;
    /* More substantial tap target */
    font-size: 14px;
    /* Increased readability */
    font-weight: 700;
    /* Solid weight */
    color: var(--text-secondary);
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.02em;
}

.segment-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.5);
}

.segment-item.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* --- Table Styles --- */
.loan-table-container {
    width: 100%;
    overflow-x: auto;
}

.loan-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}

.loan-table th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    z-index: 10;
    padding: 14px 24px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.loan-table th a {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

.sort-icon {
    font-size: 14px;
    opacity: 0.5;
}

.loan-table td {
    padding: 18px 24px;
    font-size: 14px;
    color: var(--text-primary);
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.animate-row {
    opacity: 0;
    animation: fadeInRow 0.4s ease forwards;
    animation-delay: calc(var(--row-index) * 0.05s);
}

@keyframes fadeInRow {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.loan-table tbody tr:hover {
    background: #f9fafb;
}

/* --- Cell Typography --- */
.id-text {
    font-weight: 700;
    color: var(--primary);
}

.muted-id {
    color: var(--text-muted);
    font-size: 12px;
}

.name-text {
    font-weight: 600;
}

.amount-text {
    font-weight: 700;
    color: #1e293b;
}

.date-text {
    color: var(--text-secondary);
    font-size: 13px;
}

/* --- Status Badges (Refined) --- */
[class^="status-badge-"] {
    display: inline-flex;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

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

.status-badge-closed {
    background: #fee2e2;
    color: #b91c1c;
}

.status-badge-extended {
    background: #f3e8ff;
    color: #7e22ce;
}

/* --- Action Button --- */
.btn-view {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #eff6ff;
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-pill);
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.btn-view:hover {
    background: var(--primary);
    color: white;
    transform: translateX(2px);
}

/* --- Empty State --- */
.empty-state {
    padding: 80px 40px;
    text-align: center;
}

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

.empty-state h4 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* --- Responsive --- */
@media (max-width: 1024px) {

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

@media (max-width: 768px) {
    .list-header {
        overflow-x: auto;
    }

    .dash-page-header h3 {
        font-size: 20px;
    }
}