:root {
    --color-primary: #2f6fed;
    --color-primary-dark: #1f4fbf;
    --color-bg: #f4f6fb;
    --color-surface: #ffffff;
    --color-border: #e2e6ef;
    --color-text: #1c2333;
    --color-text-muted: #6b7280;
    --color-danger: #d9364a;
    --color-success: #1f9d55;
    --radius: 10px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
    --shadow-md: 0 4px 16px rgba(16, 24, 40, 0.08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
}

.topbar {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 17px;
    color: var(--color-primary-dark);
}

.brand i { font-size: 22px; }

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--color-text-muted);
    font-size: 14px;
}

.inline-form { display: inline; }

.page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.filter-card {
    padding: 20px 24px;
    margin-bottom: 20px;
}

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

.field { display: flex; flex-direction: column; gap: 6px; }

.field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
}

.field input,
.field select {
    padding: 9px 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    color: var(--color-text);
}

.field input:focus,
.field select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.15);
}

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

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
}

.btn-primary:hover { background: var(--color-primary-dark); }

.btn-secondary {
    background: #fff;
    color: var(--color-text);
    border-color: var(--color-border);
}

.btn-secondary:hover { background: #f0f2f7; }

.btn-ghost {
    background: transparent;
    color: var(--color-text-muted);
    border: none;
}

.btn-ghost:hover { color: var(--color-danger); }

.table-card {
    padding: 0;
    overflow-x: auto;
}

table.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    min-width: 1200px;
}

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

table.report-table th:nth-child(1),
table.report-table th:nth-child(2),
table.report-table th:nth-child(3),
table.report-table th:nth-child(4),
table.report-table td:nth-child(1),
table.report-table td:nth-child(2),
table.report-table td:nth-child(3),
table.report-table td:nth-child(4) {
    text-align: left;
}

table.report-table thead th {
    background: #f8f9fc;
    color: var(--color-text-muted);
    font-weight: 600;
    position: sticky;
    top: 0;
}

table.report-table thead th a {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

table.report-table thead th a:hover { color: var(--color-primary); }

table.report-table tbody tr:hover { background: #f8f9fc; }

td.balance-cell { font-weight: 700; }
td.balance-negative { color: var(--color-danger); }
td.balance-positive { color: var(--color-success); }

.empty-state {
    padding: 60px 20px;
    text-align: center;
    color: var(--color-text-muted);
}

.empty-state i { font-size: 40px; display: block; margin-bottom: 10px; }

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2f6fed 0%, #1c2333 100%);
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 380px;
    background: #fff;
    border-radius: 14px;
    padding: 36px 32px;
    box-shadow: var(--shadow-md);
}

.login-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--color-text);
}

.login-subtitle {
    color: var(--color-text-muted);
    font-size: 13.5px;
    margin-bottom: 24px;
}

.login-error {
    background: #fdecee;
    color: var(--color-danger);
    border: 1px solid #f6c4cb;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13.5px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.field-error {
    color: var(--color-danger);
    font-size: 12.5px;
}

.login-submit { width: 100%; justify-content: center; margin-top: 8px; }

.result-count {
    padding: 14px 20px;
    color: var(--color-text-muted);
    font-size: 13.5px;
    border-bottom: 1px solid var(--color-border);
}

.pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 16px 20px;
    flex-wrap: wrap;
}

.pagination .btn {
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 600;
}

.btn-disabled {
    pointer-events: none;
    opacity: 0.45;
}
