:root {
    --green: #389685;
    --green-dark: #0c4221;
    --green-deep: #082f19;
    --lime: #d7df23;
    --lime-dark: #c9d41a;
    --bg: #eef2f4;
    --card: #ffffff;
    --muted: #6d6f71;
    --border: #e2e6e8;
    --ok: #1d9e5f;
    --bad: #d64545;
    --ink: #12241a;
}

* {
    box-sizing: border-box;
}

/* The [hidden] attribute must always win over display rules above. */
[hidden] {
    display: none !important;
}

body {
    margin: 0;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

/* ---- Login view ---- */

#login-view {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 36px 20px;
    background:
        radial-gradient(900px 480px at 12% -8%, rgba(101, 206, 173, 0.32), transparent 60%),
        radial-gradient(720px 440px at 108% 12%, rgba(215, 223, 35, 0.20), transparent 55%),
        linear-gradient(155deg, #0b3d20 0%, #0e5230 48%, var(--green-deep) 100%);
    overflow: hidden;
}

#login-view::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
    background-size: 26px 26px;
    pointer-events: none;
}

#login-view::after {
    content: "";
    position: absolute;
    width: 460px;
    height: 460px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    filter: blur(70px);
    top: -140px;
    right: -90px;
    pointer-events: none;
}

.card {
    background: var(--card);
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
    padding: 34px 32px 28px;
    text-align: left;
}

.brand-mark {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.brand-logo {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, var(--lime), var(--lime-dark));
    color: var(--green-dark);
    flex: none;
    box-shadow: 0 8px 16px rgba(215, 223, 35, 0.35);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.brand-name {
    font-size: 16px;
    font-weight: 800;
    color: var(--green-dark);
    letter-spacing: 0.2px;
}

.brand-sub {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

.login-card h1 {
    margin: 0 0 8px;
    font-size: 24px;
    color: var(--green-dark);
    font-weight: 800;
    letter-spacing: -0.3px;
}

.muted {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    margin: 0 0 18px;
}

.field-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #3c4a41;
    margin: 0 0 6px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.login-card input {
    width: 100%;
    padding: 13px 14px;
    margin-bottom: 16px;
    border: 1px solid #dbe1e2;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    background: #f6f8f7;
    color: var(--ink);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.login-card input:focus {
    border-color: var(--green);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(56, 150, 133, 0.16);
}

.login-card button {
    width: 100%;
    padding: 14px;
    margin-top: 4px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(180deg, #e0e82e, var(--lime-dark));
    color: var(--green-dark);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(201, 212, 26, 0.35);
    transition: transform 0.08s ease, box-shadow 0.15s ease;
}

.login-card button:hover {
    transform: translateY(-1px);
}

.login-card button:active {
    transform: translateY(0);
}

.login-card button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.footnote {
    color: #88908b;
    font-size: 12px;
    margin: 16px 0 0;
    text-align: center;
    line-height: 1.5;
}

.login-footer {
    position: relative;
    z-index: 1;
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    text-align: center;
    margin: 0;
}

.error,
.notice {
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 13px;
}

.error {
    background: #fddfdf;
    border: 1px solid #f1a899;
    color: #5f3f3f;
    text-align: left;
}

.notice {
    background: #eef6ff;
    border: 1px solid #b3d9ff;
    color: #1a5a9c;
    text-align: left;
}

/* ---- Top bar ---- */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    background: linear-gradient(90deg, var(--green-dark), #0e5730);
    color: #fff;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.14);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: 0.2px;
}

.brand::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: var(--lime);
    box-shadow: 0 0 0 3px rgba(215, 223, 35, 0.22);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.user-name {
    font-size: 13px;
    color: #cfe6db;
}

.ghost {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    border-radius: 8px;
    padding: 7px 13px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.15s ease;
}

.ghost:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* ---- Layout ---- */

main {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* ---- Stat cards ---- */

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.card {
    padding: 20px;
}

.stat {
    position: relative;
    overflow: hidden;
    padding: 22px;
    border-radius: 16px;
}

.stat::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--green);
}

#stat-attempts.stat::before {
    background: #3156a8;
}

#stat-successes.stat::before {
    background: var(--ok);
}

#stat-failures.stat::before {
    background: var(--bad);
}

#stat-total.stat::before {
    background: #b8860b;
}

#stat-uptime.stat::before {
    background: #88908b;
}

.stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted);
    margin-bottom: 10px;
    font-weight: 700;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--green-dark);
}

.stat-value.ok {
    color: var(--ok);
}

.stat-value.bad {
    color: var(--bad);
}

/* ---- Content cards ---- */

.card h2 {
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 800;
    color: var(--green-dark);
}

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

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th,
td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

th {
    color: var(--muted);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.4px;
    font-weight: 700;
}

tbody tr:last-child td {
    border-bottom: 0;
}

/* ---- Events ---- */

.events {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    max-height: 320px;
    overflow-y: auto;
}

.events li {
    display: flex;
    gap: 10px;
    align-items: baseline;
    padding: 8px 12px;
    background: #f7f8f9;
    border-radius: 8px;
}

.events .empty {
    color: var(--muted);
    justify-content: center;
}

.ev-time {
    color: var(--muted);
    font-size: 12px;
    flex: none;
}

.ev-type {
    flex: none;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 2px 7px;
    border-radius: 4px;
}

.ev-type.login_attempt {
    background: #e8eefc;
    color: #3156a8;
}

.ev-type.login_success {
    background: #e2f5ea;
    color: var(--ok);
}

.ev-type.login_failure {
    background: #fde7e7;
    color: var(--bad);
}

.ev-type.transfer_success {
    background: #fff6d6;
    color: #8a6d00;
}

.ev-desc {
    word-break: break-word;
}

/* ---- Admin (superadmin) ---- */

.admin-badge {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--green-dark);
    background: var(--lime);
    border-radius: 4px;
    padding: 2px 7px;
    margin-left: 6px;
    vertical-align: middle;
}

.admin-tools {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.admin-tools input {
    flex: 1;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: 9px;
    font-size: 14px;
    outline: none;
    background: #f6f8f7;
}

.admin-tools input:focus {
    border-color: var(--green);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(56, 150, 133, 0.16);
}

.search-btn {
    padding: 11px 18px;
    border: 0;
    border-radius: 9px;
    background: linear-gradient(180deg, #e0e82e, var(--lime-dark));
    color: var(--green-dark);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-size: 13px;
    cursor: pointer;
    flex: none;
}

.lookup-results {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lookup-row {
    background: #f2f8f4;
    border: 1px solid #d8e9e1;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13px;
}

.lookup-results .empty {
    color: var(--muted);
    font-size: 13px;
}

.admin-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.admin-col h3 {
    margin: 0 0 10px;
    font-size: 13px;
    color: var(--green-dark);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.admin-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#banks-list {
    max-height: 280px;
    overflow-y: auto;
    padding-right: 6px;
}

.admin-list li {
    display: flex;
    gap: 10px;
    align-items: baseline;
    font-size: 13px;
    padding: 6px 8px;
    background: #f7f8f9;
    border-radius: 6px;
}

.admin-list .empty {
    color: var(--muted);
    justify-content: center;
}

.admin-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    color: #3156a8;
    background: #e8eefc;
    border-radius: 4px;
    padding: 1px 6px;
    flex: none;
}

.admin-acct {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    color: var(--green-dark);
    flex: none;
}

.admin-tag {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 2px 7px;
    border-radius: 4px;
    flex: none;
    margin-left: auto;
}

.admin-tag.instapay {
    background: #e8eefc;
    color: #3156a8;
}

.admin-tag.landbank {
    background: #e2f5ea;
    color: var(--ok);
}

.audit-block {
    margin-top: 18px;
}

.audit-block h3 {
    margin: 0 0 10px;
    font-size: 13px;
    color: var(--green-dark);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.ok {
    color: var(--ok);
    font-weight: 700;
}

.bad {
    color: var(--bad);
    font-weight: 700;
}

.admin-add {
    margin-bottom: 18px;
    padding: 14px;
    background: #f7f8f9;
    border-radius: 10px;
}

.admin-add h3 {
    margin: 0 0 10px;
    font-size: 13px;
    color: var(--green-dark);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.admin-add-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-add-row input {
    flex: 1 1 180px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    background: #fff;
}

.admin-add-row input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(56, 150, 133, 0.16);
}

.admin-add-row select {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    background: #fff;
    max-width: 260px;
}

@media (max-width: 640px) {
    .admin-cols {
        grid-template-columns: 1fr;
    }
}
