@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #f4f6fa;
    --navy: #111c32;
    --primary: #315efb;
    --text: #182238;
    --muted: #7c879b;
    --border: #e8ecf3;
    --white: #ffffff;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'DM Sans', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

button, input { font: inherit; }
button { cursor: pointer; }

.loading {
    padding: 60px 20px;
    text-align: center;
    color: var(--muted);
}

.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: white;
}

.login-brand {
    background: linear-gradient(145deg, #101a30, #1d3671);
    color: white;
    padding: 9%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.brand-logo {
    font-size: 25px;
    font-weight: 800;
    letter-spacing: -.8px;
}

.brand-logo span { color: #76a0ff; }

.brand-message h1 {
    font-size: clamp(32px, 4vw, 54px);
    line-height: 1.15;
    margin: 0 0 20px;
}

.brand-message p {
    color: #c1cde5;
    line-height: 1.8;
    max-width: 430px;
}

.login-area {
    display: grid;
    place-items: center;
    padding: 30px;
}

.login-card { width: min(100%, 410px); }

.login-card h2 {
    font-size: 29px;
    margin: 0 0 8px;
}

.muted { color: var(--muted); }

.field { margin-top: 22px; }

.field label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 9px;
}

.field input {
    width: 100%;
    padding: 14px 15px;
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
    background: #fbfcfe;
}

.field input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px #315efb18;
}

.primary-btn {
    width: 100%;
    padding: 15px;
    margin-top: 25px;
    border: 0;
    border-radius: 10px;
    background: var(--primary);
    color: white;
    font-weight: 700;
}

.primary-btn:disabled { opacity: .6; }

.error {
    color: #c83345;
    background: #fff0f1;
    padding: 11px;
    border-radius: 8px;
    font-size: 13px;
    margin-top: 15px;
}

.app-layout { min-height: 100vh; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 250px;
    background: var(--navy);
    color: white;
    padding: 27px 18px;
    display: flex;
    flex-direction: column;
    z-index: 5;
}

.sidebar .brand-logo { padding: 0 12px 38px; }

.nav-label {
    color: #8190aa;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    padding: 0 12px 12px;
}

.nav-link {
    width: 100%;
    border: 0;
    background: transparent;
    color: #c4cee0;
    padding: 13px 12px;
    border-radius: 9px;
    text-align: left;
    margin-bottom: 5px;
    font-size: 14px;
}

.nav-link.active, .nav-link:hover {
    background: #26395d;
    color: white;
}

.sidebar-bottom {
    margin-top: auto;
    border-top: 1px solid #2c3a53;
    padding-top: 18px;
}

.main-area { margin-left: 250px; }

.topbar {
    height: 76px;
    background: white;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 35px;
}

.topbar h2 { font-size: 17px; margin: 0; }

.user-chip {
    display: flex;
    align-items: center;
    gap: 11px;
    font-size: 13px;
    font-weight: 700;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #e8eeff;
    color: var(--primary);
    display: grid;
    place-items: center;
    font-weight: 800;
}

.content {
    padding: 32px 35px;
    max-width: 1450px;
    margin: auto;
}

.welcome h1 { font-size: 25px; margin: 0 0 7px; }
.welcome p { color: var(--muted); margin: 0; font-size: 14px; }

.stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin: 27px 0;
}

.stat-card, .panel {
    background: white;
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 22px;
}

.stat-card small {
    color: var(--muted);
    font-weight: 600;
}

.stat-card strong {
    display: block;
    font-size: 26px;
    margin-top: 13px;
}

.stat-note {
    font-size: 12px;
    color: var(--muted);
    margin-top: 7px;
}

.panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.panel-heading h3 { font-size: 16px; margin: 0; }

.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 650px;
}

th {
    text-align: left;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 13px 10px;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 15px 10px;
    border-bottom: 1px solid #f0f2f6;
    font-size: 13px;
}

.amount { font-weight: 700; }
.credit { color: #15966b; }
.debit { color: #d34d5d; }

.status {
    display: inline-block;
    border-radius: 20px;
    padding: 5px 9px;
    background: #eef2f8;
    font-size: 11px;
    font-weight: 700;
}

.status.successful, .status.posted {
    color: #13855f;
    background: #e7f7ef;
}

.status.failed, .status.rejected, .status.reversed {
    color: #c23f50;
    background: #fff0f1;
}

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
    color: var(--muted);
    font-size: 12px;
}

.page-actions { display: flex; gap: 8px; }

.secondary-btn {
    border: 1px solid var(--border);
    background: white;
    padding: 9px 13px;
    border-radius: 8px;
    color: var(--text);
}

.secondary-btn:disabled { opacity: .4; cursor: not-allowed; }

.empty {
    padding: 35px;
    text-align: center;
    color: var(--muted);
}

.mobile-menu { display: none; }

@media (max-width: 800px) {
    .login-page { grid-template-columns: 1fr; }
    .login-brand { display: none; }
    .login-area { min-height: 100vh; padding: 24px; }

    .sidebar {
        transform: translateX(-100%);
        transition: transform .2s;
    }

    .sidebar.open { transform: translateX(0); }
    .main-area { margin-left: 0; }
    .topbar { padding: 0 17px; height: 66px; }
    .content { padding: 25px 16px; }
    .stats { grid-template-columns: 1fr; gap: 12px; }
    .stat-card { padding: 17px; }
    .stat-card strong { font-size: 23px; }
    .mobile-menu {
        display: inline-block;
        border: 0;
        background: transparent;
        font-size: 22px;
        margin-right: 12px;
    }
}
