body {
    font-family: Arial;
    margin: 15px;
    background: #f2f2f2;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.wrap {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.panel {
    flex: 1;
    background: white;
    padding: 15px;
    border-radius: 10px;
    overflow: auto;
}

table {

    width: 100%;

    border-collapse: separate;

    border-spacing: 0;

    overflow: hidden;

    border-radius: 12px;

    background: white;

    box-shadow:
        0 2px 8px rgba(0, 0, 0, .08);

}

th {

    background: #1f4f8f;
    color: white;
    padding: 12px;
    font-size: 13px;
    font-weight: bold;
    border-right: 1px solid rgba(255,
            255,
            255,
            0.15);
}

th:hover {

    opacity: .9;

}

td {
    padding: 10px;
    font-size: 13px;
    border-bottom: 1px solid #dfe3ea;
    border-right: 1px solid #eceff4;
}

th:last-child,
td:last-child {

    border-right: none;

}

/* garis atas antar row */

tbody tr {

    border-bottom: 1px solid #dfe3ea;

}

/* zebra row */

tbody tr:nth-child(odd) {

    background: #ffffff;

}

tbody tr:nth-child(even) {

    background: #d4e0ff;

}

/* hover */

tbody tr:hover {

    background: #dfeaff;

    transition: .2s;

}

/* rounded corner */

thead tr th:first-child {

    border-top-left-radius: 12px;

}

thead tr th:last-child {

    border-top-right-radius: 12px;

}

/* nominal rata kanan */

td:last-child {

    white-space: nowrap;

}

table button {

    padding: 6px 10px;

    border: none;

    border-radius: 8px;

    font-size: 12px;

}

/* kolom nominal */

th:nth-child(4),
td:nth-child(4) {

    width: 1%;

    white-space: nowrap;

    min-width: 120px;

    text-align: right;

}

/* jika admin login ada kolom user + aksi */

td:nth-child(5) {

    font-weight: bold;

}

.panel {

    flex: 1;

    background: white;

    padding: 15px;

    border-radius: 12px;

    overflow: auto;

    box-shadow:
        0 2px 10px rgba(0, 0, 0, .08);

}

input {
    width: 100%;
    padding: 8px;
    margin-bottom: 8px;
    box-sizing: border-box;
}

button {
    padding: 8px;
    cursor: pointer;
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
}

.modal-box {
    background: white;
    width: 350px;
    max-width: 95%;
    padding: 20px;
    margin: 100px auto;
    border-radius: 10px;
}

@media(max-width:800px) {
    .wrap {
        flex-direction: column;
    }
}

button:hover {

    opacity: .9;

}

.banner {

    background: linear-gradient(135deg,
            #1f4f8f,
            #2f74d0);

    color: white;

    padding: 25px;

    border-radius: 12px;

    margin-bottom: 20px;

    text-align: center;

    box-shadow:
        0 3px 10px rgba(0, 0, 0, .15);

}

.banner h1 {

    margin: 0;

    font-size: 32px;

}

.banner p {

    margin-top: 8px;

    opacity: .9;

}

@media(max-width:800px) {

    .banner h1 {

        font-size: 24px;

    }

    .banner {

        padding: 18px;

    }

}

.btn-login,
.btn-user,
.btn-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: bold;
    transition: .25s;
    margin: 4px;
}

.btn-login {

    background: #2f74d0;

    color: white;

    box-shadow:
        0 3px 8px rgba(0, 0, 0, .2);

}

.btn-login:hover {

    transform: translateY(-2px);

    background: #1f5eb5;

}

.btn-user {

    background: #18a558;

    color: white;

}

.btn-user:hover {

    background: #138446;

}

.btn-logout {

    background: #d33;

    color: white;

}

.btn-logout:hover {

    background: #b52222;

}

.topbar {

    display: flex;

    justify-content: space-between;

    align-items: center;

    flex-wrap: wrap;

    gap: 10px;

}

.summary {

    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 15px;

    margin: 20px 0;

}

.badge {
    padding: 20px;
    border-radius: 14px;
    color: white;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, .15);
    transition: .25s;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 110px;

}

.badge:hover {

    transform: translateY(-3px);

}

.badge-title {
    font-size: 13px;
    opacity: .9;
    font-weight: bold;
    letter-spacing: 1px;

}

.badge-value {
    margin-top: 10px;
    font-size: 28px;
    font-weight: bold;
    word-break: break-word;
    overflow: hidden;
    text-overflow: ellipsis;

}

.badge-income {

    background: linear-gradient(135deg,
            #16a34a,
            #22c55e);

}

.badge-expense {

    background: linear-gradient(135deg,
            #dc2626,
            #ef4444);

}

.badge-balance {

    background: linear-gradient(135deg,
            #2563eb,
            #3b82f6);

}

@media(max-width:800px) {

    .summary {

        grid-template-columns: 1fr;

    }

    .badge-value {

        font-size: 22px;

    }

}

.footer {
    margin-top: 30px;
    padding: 20px;
    text-align: center;
    border-top: 3px solid #2f74d0;
    background: white;
    border-radius: 0 0 10px 10px;
}

.btn-add-income,
.btn-add-expense {

    border: none;

    padding: 12px 18px;

    border-radius: 12px;

    font-weight: bold;

    cursor: pointer;

    color: white;

    margin-bottom: 12px;

    transition: .25s;

    box-shadow:
        0 4px 10px rgba(0, 0, 0, .15);

}

.btn-add-income {

    background: linear-gradient(135deg,
            #16a34a,
            #22c55e);

}

.btn-add-income:hover {

    transform: translateY(-2px);

    box-shadow:
        0 6px 14px rgba(0, 0, 0, .2);

}

.btn-add-expense {

    background: linear-gradient(135deg,
            #1da734,
            #0c9c13);

}

.btn-add-expense:hover {

    transform: translateY(-2px);

    box-shadow:
        0 6px 14px rgba(0, 0, 0, .2);

}

@media(max-width:800px) {

    .btn-add-income,
    .btn-add-expense {

        width: 100%;

    }

}

.btn-export {

    display: inline-block;

    padding: 10px 18px;

    background: #0f9d58;

    color: white;

    text-decoration: none;

    border-radius: 10px;

    font-weight: bold;

    margin: 4px;

    transition: .2s;

}

.btn-export:hover {

    background: #0b8043;

    transform: translateY(-2px);

}

.filter-box {

    width: 100%;

    padding: 10px;

    margin-bottom: 10px;

    border: 1px solid #ccc;

    border-radius: 10px;

    background: white;

}

#loginMsg {

    color: red;

    margin-top: 10px;

}

#loginModal .modal-box {

    width: 320px;

}

#loginModal input {

    margin-bottom: 10px;

}

.panel-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.last-update {
    padding: 8px 12px;
    background: #eef3ff;
    border-radius: 20px;
    font-size: 12px;
    color: #444;
    border: 1px solid #d6def5;
    white-space: nowrap;
}