:root {
    --red: #c8102e;
    --red-dark: #8f0d23;
    --red-soft: #fff1f3;
    --ink: #201a1c;
    --muted: #776b70;
    --line: #eadfe2;
    --panel: #ffffff;
    --bg: #fbf8f9;
    --green: #0f8a4b;
    --amber: #9a6700;
    --shadow: 0 14px 40px rgba(70, 20, 30, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    background: var(--panel);
}

.login-brand {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px;
    background: linear-gradient(135deg, var(--red), var(--red-dark));
    color: #ffffff;
}

.brand-mark,
.app-mark {
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 8px;
    background: #ffffff;
    color: var(--red);
    font-weight: 800;
}

.login-brand h1 {
    max-width: 620px;
    margin: 80px 0 18px;
    font-size: 52px;
    line-height: 1.03;
    letter-spacing: 0;
}

.login-brand p {
    max-width: 560px;
    color: #ffe3e8;
    font-size: 18px;
}

.login-card {
    align-self: center;
    width: min(440px, calc(100% - 48px));
    margin: auto;
    padding: 36px;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.login-card h2,
.page-title h1 {
    margin: 0;
    font-size: 28px;
}

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

.step-indicator {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 20px 0 24px;
}

.step-indicator span {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f9f4f5;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    transition: all 0.2s ease;
}

.step-indicator span.active {
    background: var(--red);
    border-color: var(--red);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(200, 16, 46, 0.18);
}

.progress-track {
    height: 5px;
    margin: -12px 0 24px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--line);
}

.progress-track span {
    display: block;
    width: 33.333%;
    height: 100%;
    border-radius: inherit;
    background: var(--red);
    transition: width 0.25s ease;
}

.form-step {
    display: none;
}

.form-step.active {
    display: block;
}

.step-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}

.step-actions [data-prev] {
    visibility: hidden;
}

.step-actions [data-submit] {
    display: none;
}

.demo-logins {
    display: grid;
    gap: 10px;
    margin-top: 22px;
    padding: 16px;
    background: var(--red-soft);
    border: 1px solid #ffd5dc;
    border-radius: 8px;
    font-size: 14px;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 264px 1fr;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 24px 18px;
    background: var(--red);
    color: #ffffff;
}

.brand-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 34px;
    font-weight: 800;
}

.app-mark {
    background: #ffffff;
    color: var(--red);
}

.nav {
    display: grid;
    gap: 8px;
}

.nav a {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #ffe7eb;
}

.nav a.active,
.nav a:hover {
    background: #ffffff;
    color: var(--red);
}

.sidebar-footer {
    position: absolute;
    right: 18px;
    bottom: 24px;
    left: 18px;
}

.logout {
    display: block;
    padding: 11px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    text-align: center;
}

.main {
    min-width: 0;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 30px;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-menu-toggle {
    display: none;
}

.content {
    padding: 30px;
}

.grid {
    display: grid;
    gap: 18px;
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel,
.metric,
.table-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.panel,
.table-panel {
    padding: 22px;
}

.metric {
    padding: 20px;
}

.metric span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
}

.metric strong {
    display: block;
    margin-top: 8px;
    color: var(--red-dark);
    font-size: 28px;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.section-head h2,
.panel h2 {
    margin: 0;
    font-size: 20px;
}

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border: 0;
    border-radius: 8px;
    background: var(--red);
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
}

button.is-loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

button.is-loading::after {
    position: absolute;
    width: 17px;
    height: 17px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: button-spin 0.7s linear infinite;
    content: '';
}

.form-is-loading {
    position: relative;
}

.form-is-loading::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    border: 3px solid rgba(200, 16, 46, 0.18);
    border-top-color: var(--red);
    border-radius: 50%;
    animation: button-spin 0.7s linear infinite;
    content: '';
    transform: translate(-50%, -50%);
}

@keyframes button-spin {
    to { transform: rotate(360deg); }
}

.button.secondary,
button.secondary {
    background: #ffffff;
    color: var(--red);
    border: 1px solid var(--red);
}

.button.danger,
button.danger {
    background: var(--red-dark);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.field {
    display: grid;
    gap: 7px;
}

.edit-transaction-form {
    display: grid;
    min-width: 260px;
    gap: 8px;
    margin-top: 10px;
}

.transfer-pin-display {
    display: grid;
    gap: 4px;
    width: fit-content;
    margin-top: 22px;
    padding: 14px 18px;
    border-left: 4px solid var(--red);
    background: var(--red-soft);
}

.transfer-pin-display strong {
    color: var(--red-dark);
    font-size: 24px;
    letter-spacing: 0.18em;
}

.pin-panel {
    display: grid;
    justify-items: center;
    gap: 16px;
    max-width: 360px;
    margin: 8px auto 0;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffafb;
    text-align: center;
}

.pin-panel h3 {
    margin: 4px 0;
    font-size: 22px;
}

.eyebrow {
    color: var(--red);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.pin-input {
    width: 190px;
    min-height: 54px;
    border: 2px solid var(--red);
    font-size: 28px;
    letter-spacing: 0.45em;
    text-align: center;
}

.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 64px);
    gap: 9px;
}

.pin-key {
    min-height: 52px;
    padding: 8px;
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--ink);
    font-size: 18px;
}

.pin-key:hover {
    border-color: var(--red);
    background: var(--red-soft);
}

.pin-key.pin-action {
    color: var(--red);
    font-size: 12px;
}

.pin-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.field.full {
    grid-column: 1 / -1;
}

label {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
}

textarea {
    min-height: 86px;
    resize: vertical;
}

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

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

th,
td {
    padding: 13px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--red-soft);
    color: var(--red-dark);
    font-size: 12px;
    font-weight: 800;
    text-transform: capitalize;
}

.badge.approved,
.badge.successful,
.badge.active,
.badge.credit {
    background: #eaf8f0;
    color: var(--green);
}

.badge.pending {
    background: #fff7e0;
    color: var(--amber);
}

.badge.rejected,
.badge.debit {
    background: var(--red-soft);
    color: var(--red-dark);
}

.flash {
    margin-bottom: 18px;
    padding: 13px 16px;
    border-radius: 8px;
    border: 1px solid;
}

.flash.success {
    border-color: #bfe7cf;
    background: #edf9f2;
    color: #11683b;
}

.flash.error {
    border-color: #ffcbd4;
    background: var(--red-soft);
    color: var(--red-dark);
}

.account-card {
    display: grid;
    gap: 10px;
    padding: 20px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--red), var(--red-dark));
    color: #ffffff;
}

.account-card strong {
    font-size: 24px;
}

.quick-list {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.quick-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.quick-list li:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

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

.reject-form {
    display: flex;
    gap: 8px;
}

.reject-form input {
    min-width: 180px;
}

@media (max-width: 920px) {
    .login-shell,
    .app-shell {
        grid-template-columns: 1fr;
    }

    .login-brand {
        min-height: 360px;
    }

    .login-brand h1 {
        margin-top: 48px;
        font-size: 40px;
    }

    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: -300px;
        width: 280px;
        height: 100vh;
        z-index: 20;
        transition: left 0.2s ease;
        box-shadow: 0 18px 40px rgba(32, 26, 28, 0.18);
    }

    .sidebar.mobile-open {
        left: 0;
    }

    .sidebar-footer {
        position: static;
        margin-top: 18px;
    }

    .nav {
        grid-template-columns: 1fr;
    }

    .grid-2,
    .grid-3,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .content,
    .topbar {
        padding: 20px;
    }

    .mobile-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: var(--red-soft);
        color: var(--red-dark);
        font-size: 24px;
        cursor: pointer;
    }

    .topbar {
        position: sticky;
        top: 0;
        z-index: 15;
    }

    .topbar-user {
        display: none;
    }

    .page-title h1 {
        font-size: 22px;
    }
}

@media (max-width: 560px) {
    .login-brand,
    .login-card {
        padding: 24px;
    }

    .login-card {
        width: 100%;
        border: 0;
        box-shadow: none;
    }

    .nav {
        grid-template-columns: 1fr;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }
}
