:root {
    --bg: #f4f6f8;
    --text: #17202a;
    --muted: #657084;
    --line: #d9dee7;
    --panel: #ffffff;
    --primary: #0f766e;
    --primary-dark: #115e59;
    --danger: #b42318;
    --income: #0f766e;
    --expense: #b42318;
}

* {
    box-sizing: border-box;
}

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

a {
    color: var(--primary-dark);
    text-decoration: none;
}

.topbar {
    align-items: center;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 18px clamp(16px, 4vw, 48px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar h1,
.panel h2 {
    margin: 0;
}

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

.brand-mark,
.summary-icon {
    align-items: center;
    border-radius: 8px;
    display: inline-flex;
    font-weight: 800;
    justify-content: center;
}

.brand-mark {
    background: var(--primary);
    color: #ffffff;
    height: 44px;
    width: 44px;
}

.topbar nav,
.actions,
.form-actions,
.panel-actions {
    align-items: center;
    display: flex;
    gap: 12px;
}

.topbar nav {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-link {
    border-radius: 8px;
    color: var(--text);
    font-weight: 700;
    padding: 8px 10px;
}

.nav-link:hover {
    background: #eef5f4;
    color: var(--primary-dark);
}

.eyebrow {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    margin: 0 0 4px;
    text-transform: uppercase;
}

.page {
    margin: 0 auto;
    max-width: 1220px;
    padding: 24px 16px 48px;
}

.button,
button {
    background: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 8px;
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 700;
    justify-content: center;
    min-height: 42px;
    padding: 9px 16px;
}

.button:hover,
button:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.button-light {
    background: #e8f5f2;
    border-color: #b7ddd5;
    color: var(--primary-dark);
}

.button-secondary {
    background: #ffffff;
    border-color: var(--line);
    color: var(--text);
}

.button-secondary:hover {
    background: #f6f8fa;
    border-color: #c7ced9;
    color: var(--text);
}

.admin-name {
    color: var(--muted);
    font-weight: 700;
}

.auth-page {
    align-items: center;
    display: flex;
    min-height: 100vh;
}

.login-shell {
    margin: 0 auto;
    max-width: 460px;
    padding: 24px 16px;
    width: 100%;
}

.login-panel {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 28px;
}

.login-panel h1 {
    margin: 0;
}

.login-copy {
    color: var(--muted);
    margin: 6px 0 22px;
}

.login-form {
    display: grid;
    gap: 16px;
}

.login-form label {
    display: grid;
    gap: 7px;
}

.login-form span {
    font-weight: 700;
}

.summary-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 22px;
}

.summary-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px;
    position: relative;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.summary-card.income {
    border-top: 4px solid var(--income);
}

.summary-card.expense {
    border-top: 4px solid var(--expense);
}

.summary-card.balance {
    border-top: 4px solid #2563eb;
}

.summary-icon {
    background: #eef5f4;
    color: var(--primary-dark);
    font-size: 12px;
    height: 34px;
    margin-bottom: 14px;
    width: 42px;
}

.summary-card span {
    color: var(--muted);
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
}

.summary-card strong {
    display: block;
    font-size: 30px;
    margin-bottom: 6px;
}

.summary-card small {
    color: var(--muted);
}

.panel {
    overflow: hidden;
}

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

.panel-subtitle {
    color: var(--muted);
    margin: 4px 0 0;
}

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

.filter-form {
    align-items: end;
    background: #fbfcfd;
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(150px, 1fr)) auto;
    padding: 18px 22px;
}

.filter-form label {
    display: grid;
    gap: 7px;
}

.filter-form span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.filter-actions {
    display: flex;
    gap: 10px;
}

.dashboard-hero {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
    padding: 24px;
}

.dashboard-hero h2 {
    font-size: 36px;
    line-height: 1.1;
    margin: 0;
}

.dashboard-hero p:not(.eyebrow) {
    color: var(--muted);
    margin: 8px 0 0;
}

.hero-actions {
    display: flex;
    gap: 12px;
}

.report-body {
    background: #ffffff;
    margin: 0 auto;
    max-width: 980px;
    padding: 24px;
}

.report-title {
    border-bottom: 2px solid var(--text);
    margin-bottom: 16px;
    padding-bottom: 12px;
    text-align: center;
}

.report-title h2 {
    font-size: 24px;
    margin: 0;
    text-transform: uppercase;
}

.report-title p {
    color: var(--muted);
    margin: 4px 0 0;
}

.report-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    justify-content: center;
    margin-top: 6px;
}

.report-meta span {
    color: var(--muted);
    font-size: 13px;
}

.report-summary {
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 20px;
}

.report-summary div {
    padding: 14px 16px;
}

.report-summary div + div {
    border-left: 1px solid var(--line);
}

.report-summary span {
    color: var(--muted);
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
}

.report-summary strong {
    font-size: 20px;
}

.signature-grid {
    display: grid;
    gap: 64px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 42px;
    text-align: center;
}

.signature-block p {
    margin: 0 0 4px;
}

.signature-block strong {
    display: inline-block;
    margin-top: 48px;
    min-width: 210px;
}

table {
    border-collapse: collapse;
    width: 100%;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 15px 16px;
    text-align: left;
    vertical-align: middle;
}

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

tbody tr:hover {
    background: #fbfcfd;
}

.numeric {
    text-align: right;
    white-space: nowrap;
}

.badge {
    border-radius: 8px;
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    padding: 4px 10px;
}

.badge.masuk {
    background: #e8f5f2;
    color: var(--income);
}

.badge.keluar {
    background: #fff1f0;
    color: var(--expense);
}

.actions form {
    display: inline;
    margin: 0;
}

.actions button {
    background: transparent;
    border: 0;
    color: var(--danger);
    min-height: auto;
    padding: 0;
}

.actions a,
.actions button {
    font-weight: 700;
}

.empty {
    color: var(--muted);
    padding: 28px 16px;
    text-align: center;
}

.alert {
    background: #e8f5f2;
    border: 1px solid #b7ddd5;
    border-radius: 8px;
    color: var(--primary-dark);
    margin-bottom: 16px;
    padding: 12px 14px;
}

.alert-error {
    background: #fff1f0;
    border-color: #f1b4ad;
    color: var(--danger);
}

.form-panel {
    max-width: 820px;
}

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

.cash-form label {
    display: grid;
    gap: 7px;
}

.cash-form .full {
    grid-column: 1 / -1;
}

.cash-form span {
    font-weight: 700;
}

input,
select {
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    font: inherit;
    min-height: 44px;
    padding: 9px 12px;
    width: 100%;
}

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

.cash-form small,
.login-form small {
    color: var(--danger);
}

@media (max-width: 760px) {
    .topbar,
    .panel-head,
    .dashboard-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar nav,
    .form-actions,
    .panel-actions,
    .hero-actions {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .summary-grid,
    .cash-form,
    .filter-form,
    .report-summary,
    .signature-grid {
        grid-template-columns: 1fr;
    }

    .report-summary div + div {
        border-left: 0;
        border-top: 1px solid var(--line);
    }

    .filter-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-hero h2 {
        font-size: 28px;
    }

    .summary-card strong {
        font-size: 26px;
    }
}

@media print {
    @page {
        margin: 14mm;
        size: A4;
    }

    body {
        background: #ffffff;
        color: #000000;
        font-size: 12px;
    }

    .topbar,
    .no-print {
        display: none !important;
    }

    .page {
        max-width: none;
        padding: 0;
    }

    .panel,
    .report-summary {
        border: 0;
        border-radius: 0;
    }

    .report-body {
        padding: 0;
        max-width: none;
    }

    .report-title {
        border-bottom: 2px solid #000000;
        margin-bottom: 12px;
        padding-bottom: 8px;
    }

    .report-title h2 {
        font-size: 16px;
    }

    .report-meta {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0;
        margin-top: 4px;
    }

    .report-meta span,
    .report-title p {
        color: #000000;
        font-size: 10px;
    }

    .report-summary {
        border: 1px solid #000000;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        margin-bottom: 14px;
    }

    .report-summary div {
        padding: 8px 10px;
    }

    .report-summary div + div {
        border-left: 1px solid #000000;
        border-top: 0;
    }

    .report-summary span {
        color: #000000;
        font-size: 10px;
    }

    .report-summary strong {
        font-size: 13px;
    }

    th,
    td {
        border: 1px solid #000000;
        font-size: 10px;
        padding: 6px 7px;
    }

    th {
        color: #000000;
    }

    a {
        color: #000000;
    }

    .signature-grid {
        display: grid;
        gap: 48px;
        grid-template-columns: repeat(2, 1fr);
        margin-top: 34px;
        page-break-inside: avoid;
    }

    .signature-block strong {
        margin-top: 44px;
        min-width: 160px;
    }
}
