/* =============================================
   VERS DASHBOARD – Modern 2026 UI
   ============================================= */

:root {
    --primary: #4f46e5;          /* indigo */
    --primary-hover: #4338ca;
    --primary-light: #e0e7ff;
    --bg: #f1f5f9;              /* slate 100 */
    --card-bg: #ffffff;
    --text: #0f172a;            /* slate 900 */
    --text-secondary: #64748b;  /* slate 500 */
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -4px rgba(0,0,0,0.05);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: 0.2s ease;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Navbar ---------- */
.navbar {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.nav-brand {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.nav-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.btn-icon {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-icon:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.btn-outline {
    background: white;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.5rem 1.2rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    font-size: 0.9rem;
}
.btn-outline:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

/* ---------- Main Dashboard ---------- */
.dashboard {
    flex: 1;
    max-width: 1200px;
    width: 92%;
    margin: 2rem auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* ---------- Cards ---------- */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.75rem;
    border: 1px solid var(--border);
    transition: box-shadow var(--transition);
}
.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.card-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text);
}

.last-updated {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--bg);
    padding: 0.3rem 0.85rem;
    border-radius: 20px;
    font-weight: 500;
}

/* ---------- Balance Grid ---------- */
.balance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
}

.currency-balance {
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    padding: 1.5rem 1.25rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: all var(--transition);
    text-align: center;
}
.currency-balance:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79,70,229,0.08);
}
.currency-balance h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.75rem;
    letter-spacing: 0.3px;
}
.currency-balance p {
    font-size: 0.95rem;
    margin: 0.3rem 0;
    color: var(--text);
    font-weight: 500;
}
.currency-balance strong {
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 0.25rem;
}

/* ---------- Transactions Table ---------- */
.transaction-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -0.5rem;   /* compensate for padding */
}

.transaction-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    white-space: nowrap;
}

.transaction-table thead {
    background: #f8fafc;
}
.transaction-table th {
    text-align: left;
    padding: 0.85rem 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.transaction-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-weight: 400;
}

.transaction-table tbody tr {
    transition: background var(--transition);
}
.transaction-table tbody tr:hover {
    background: #f1f5f9;
}

/* alternating row subtle color */
.transaction-table tbody tr:nth-child(even) {
    background: #f9fafb;
}
.transaction-table tbody tr:nth-child(even):hover {
    background: #f1f5f9;
}

/* Status/type styling */
.transaction-table td:nth-child(2) {   /* Type column */
    font-weight: 600;
    text-transform: capitalize;
}
.transaction-table td:nth-child(2)[data-direction="credit"] {
    color: #059669;   /* green */
}
.transaction-table td:nth-child(2)[data-direction="debit"] {
    color: #dc2626;   /* red */
}

/* ---------- Pagination ---------- */
.pagination {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
}

#loadMoreBtn, .page-btn {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.6rem 1.5rem;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition);
    color: var(--primary);
}
#loadMoreBtn:hover, .page-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}
.page-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ---------- Footer ---------- */
.footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    text-align: center;
    padding: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: auto;
}
.footer strong {
    color: var(--primary);
    font-weight: 600;
}

/* ---------- Login page (unchanged base, just refined) ---------- */
.login-container {
    max-width: 380px;
    margin: 6rem auto;
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    text-align: center;
}
.login-container h1 {
    margin-bottom: 2rem;
    color: var(--primary);
    font-weight: 700;
}
form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
input {
    padding: 0.8rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: border var(--transition);
}
input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}
button[type="submit"] {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background var(--transition);
}
button[type="submit"]:hover {
    background: var(--primary-hover);
}
.error {
    color: #dc2626;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .dashboard {
        width: 96%;
        margin: 1.5rem auto;
        gap: 1.5rem;
    }
    .navbar {
        padding: 0 1rem;
    }
    .card {
        padding: 1.25rem;
    }
    .balance-grid {
        grid-template-columns: 1fr;
    }
    .transaction-table table {
        min-width: 600px;   /* ensures horizontal scroll */
    }
    .card-header h2 {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .nav-brand {
        font-size: 1.4rem;
    }
    .btn-outline {
        padding: 0.4rem 1rem;
        font-size: 0.85rem;
    }
    .btn-icon {
        padding: 0.4rem;
        font-size: 1.1rem;
    }
    .dashboard {
        margin: 1rem auto;
    }
    .card {
        padding: 1rem;
    }
    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .last-updated {
        align-self: flex-start;
    }
}

/* ---------- Utility classes ---------- */
.text-muted { color: var(--text-secondary); }
.text-error  { color: #dc2626; }