* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #eef3f8;
    color: #1d2939;
}

.app {
    max-width: 1220px;
    margin: 0 auto;
    padding: 24px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    background: linear-gradient(135deg, #0f766e, #0f172a);
    color: #fff;
    padding: 24px;
    border-radius: 20px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
}

.topbar h1 {
    margin: 0 0 8px;
    font-size: 28px;
}

.topbar p {
    margin: 0;
    color: #d9f7ef;
}

.total-pill {
    min-width: 230px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.22);
    padding: 16px 18px;
    border-radius: 18px;
    text-align: right;
}

.total-pill span {
    display: block;
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 6px;
}

.total-pill strong {
    font-size: 24px;
}

.tabs {
    display: flex;
    gap: 12px;
    margin: 22px 0;
    flex-wrap: wrap;
}

.tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 18px;
    border-radius: 999px;
    text-decoration: none;
    color: #344054;
    background: #fff;
    border: 1px solid #d0d5dd;
}

.tab.active {
    background: #0f766e;
    color: #fff;
    border-color: #0f766e;
}

.grid {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr;
    gap: 20px;
    margin-bottom: 20px;
}

.card {
    background: #fff;
    border: 1px solid #e4e7ec;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 10px 28px rgba(16, 24, 40, 0.06);
}

.card h2 {
    margin: 0 0 18px;
    font-size: 20px;
}

label {
    display: block;
    margin: 13px 0 7px;
    color: #344054;
}

input[type="text"],
input[type="number"],
textarea {
    width: 100%;
    border: 1px solid #d0d5dd;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 15px;
    outline: none;
    font-family: Arial, Helvetica, sans-serif;
}

input:focus,
textarea:focus {
    border-color: #0f766e;
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.type-select {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.type-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid #d0d5dd;
    cursor: pointer;
}

.type-box.income {
    background: #ecfdf3;
}

.type-box.debt {
    background: #fff1f3;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.btn {
    border: 0;
    border-radius: 12px;
    padding: 12px 18px;
    font-size: 15px;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn.primary {
    background: #0f766e;
    color: #fff;
}

.btn.light {
    background: #f2f4f7;
    color: #344054;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: 14px;
    margin-bottom: 12px;
}

.summary-row.income {
    background: #ecfdf3;
    color: #027a48;
}

.summary-row.debt {
    background: #fff1f3;
    color: #c01048;
}

.summary-row.net {
    border: 1px dashed currentColor;
}

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

.section-title h2 {
    margin: 0;
}

.section-title span {
    color: #667085;
}

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

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

th, td {
    padding: 13px 12px;
    border-bottom: 1px solid #eaecf0;
    text-align: left;
    vertical-align: top;
}

th {
    background: #f9fafb;
    color: #475467;
}

tfoot td {
    background: #f9fafb;
}

.money {
    white-space: nowrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 13px;
    white-space: nowrap;
}

.badge.income,
.badge.log-create {
    background: #dcfae6;
    color: #027a48;
}

.badge.debt,
.badge.log-delete {
    background: #ffe4e8;
    color: #c01048;
}

.badge.log-update {
    background: #e0f2fe;
    color: #026aa2;
}

.row-income {
    background: #fcfffd;
}

.row-debt {
    background: #fffbfb;
}

.income-text {
    color: #027a48;
}

.debt-text {
    color: #c01048;
}

.actions {
    white-space: nowrap;
}

.mini {
    display: inline-flex;
    padding: 7px 10px;
    border-radius: 9px;
    text-decoration: none;
    margin-right: 6px;
    font-size: 13px;
}

.mini.edit {
    background: #e0f2fe;
    color: #026aa2;
}

.mini.delete {
    background: #ffe4e8;
    color: #c01048;
}

.empty {
    text-align: center;
    color: #667085;
    padding: 24px;
}

@media (max-width: 860px) {
    .app {
        padding: 14px;
    }

    .topbar,
    .grid,
    .section-title {
        display: block;
    }

    .total-pill {
        text-align: left;
        margin-top: 18px;
        min-width: auto;
    }

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

    .summary-card {
        margin-top: 18px;
    }

    .type-select {
        grid-template-columns: 1fr;
    }
}
