body {
    font-family: Arial, sans-serif;
    background: #f5f6f8;
    margin: 0;
    padding: 0;
    color: #222;
}

.page {
    max-width: 1450px;
    margin: 0 auto;
    padding: 25px;
}

.header {
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.header h1 {
    margin: 0;
    font-size: 30px;
}

.header p {
    margin: 5px 0 0;
    color: #666;
}

.header-user {
    text-align: right;
    color: #666;
    font-size: 14px;
}

.nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.nav a {
    background: #222;
    color: #fff;
    padding: 10px 14px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
}

.nav a:hover,
.nav a.active {
    background: #555;
}

.cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
    margin-bottom: 22px;
}

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

.card {
    background: #fff;
    border-radius: 10px;
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.card .label {
    color: #666;
    font-size: 13px;
    margin-bottom: 8px;
}

.card .value {
    font-size: 24px;
    font-weight: bold;
}

.card .sub {
    color: #777;
    font-size: 13px;
    margin-top: 6px;
}

.grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: 20px;
    align-items: start;
}

.grid.form-grid {
    grid-template-columns: 420px minmax(0, 1fr);
}

.section {
    background: #fff;
    border-radius: 10px;
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 25px;
}

.section h2 {
    margin-top: 0;
    font-size: 20px;
}

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

.section-header h2 {
    margin: 0;
}

.toolbar {
    display: flex;
    gap: 12px;
    align-items: end;
    flex-wrap: wrap;
}

.filter-field {
    min-width: 180px;
}

label {
    display: block;
    margin-top: 14px;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 14px;
}

input,
select,
textarea {
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
}

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

button,
.button {
    display: inline-block;
    padding: 10px 14px;
    background: #222;
    color: #fff;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
}

button:hover,
.button:hover {
    background: #444;
}

.button.secondary,
button.secondary {
    background: #777;
}

.button.danger,
button.danger {
    background: #b00020;
}

.button.warning,
button.warning {
    background: #b56a00;
}

.button.light {
    background: #e8e8e8;
    color: #222;
}

.button.small,
button.small {
    padding: 7px 10px;
    font-size: 13px;
}

.form-actions,
.actions,
.quick-actions,
.action-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.form-actions {
    margin-top: 18px;
}

.message {
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 18px;
}

.message.success {
    background: #e7f7ea;
    color: #0a7d32;
}

.message.error {
    background: #ffe5e5;
    color: #a00000;
}

.notice {
    background: #fff4d6;
    color: #7a5200;
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 18px;
}

.hint,
.muted {
    color: #777;
}

.hint {
    margin-top: 5px;
    font-size: 13px;
}

.small {
    font-size: 13px;
}

.positive {
    color: #0a7d32;
}

.negative {
    color: #b00020;
}

.neutral {
    color: #333;
}

.right {
    text-align: right;
}

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

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

th {
    background: #f3f3f3;
}

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

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    background: #eee;
}

.badge.income,
.badge.good,
.badge.active,
.badge.matched {
    background: #e7f7ea;
    color: #0a7d32;
}

.badge.outgoing,
.badge.bad,
.badge.inactive {
    background: #ffe5e5;
    color: #a00000;
}

.badge.warning,
.badge.unmatched {
    background: #fff4d6;
    color: #7a5200;
}

.badge.auto {
    background: #e8f0ff;
    color: #174ea6;
}

.badge.ignored {
    background: #eee;
    color: #666;
}

.checkbox-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
    font-size: 14px;
}

.checkbox-row input {
    width: auto;
    margin: 0;
}

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

@media (max-width: 1100px) {
    .cards,
    .cards.secondary,
    .grid,
    .grid.form-grid,
    .split-columns {
        grid-template-columns: 1fr;
    }

    .page {
        padding: 15px;
    }

    .header-user {
        text-align: left;
    }

    .filter-field {
        width: 100%;
    }
}