:root {
    --bg: #f7f7f8;
    --panel: #ffffff;
    --border: #e2e2e6;
    --text: #1b1b1f;
    --muted: #6b6b73;
    --accent: #2456d6;
    --error: #b3261e;
    --success: #1e6b3e;
}

* {
    box-sizing: border-box;
}

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

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
}

.brand {
    font-weight: 600;
}

.topbar nav a {
    margin-left: 1.25rem;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
}

.topbar nav a:hover {
    color: var(--accent);
}

main {
    max-width: 1300px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

h1 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.auth-form {
    max-width: 340px;
    margin: 2rem auto;
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
}

.auth-form label {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 0.75rem;
}

.auth-form input {
    margin-top: 0.25rem;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
}

.auth-form button {
    margin-top: 1.25rem;
    padding: 0.6rem;
    border: none;
    border-radius: 4px;
    background: var(--accent);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
}

.auth-form .hint {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 0;
}

.flashes {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
}

.flash {
    padding: 0.6rem 0.9rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.flash-error {
    background: #fbeceb;
    color: var(--error);
    border: 1px solid #f2c9c6;
}

.flash-success {
    background: #eaf5ee;
    color: var(--success);
    border: 1px solid #c6e5d1;
}

.filter-form {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    padding: 0.9rem 1rem;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.filter-form label {
    font-size: 0.85rem;
    color: var(--muted);
}

.filter-form select {
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.9rem;
    background: var(--panel);
    color: var(--text);
}

.filter-form button {
    padding: 0.45rem 0.9rem;
    border: none;
    border-radius: 4px;
    background: var(--accent);
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
}

.filter-form .clear-link {
    font-size: 0.85rem;
    color: var(--muted);
    text-decoration: none;
    margin-left: 0.25rem;
}

.filter-form .clear-link:hover {
    color: var(--accent);
}

.stat-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin-bottom: 1.25rem;
}

.stat-tile {
    flex: 1 1 160px;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}

.stat-tile-primary {
    border-color: var(--accent);
}

.stat-tile-primary .stat-value {
    font-size: 2rem;
    color: var(--accent);
}

.table-wrap {
    overflow-x: auto;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th, td {
    text-align: left;
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

th {
    color: var(--muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

th.num, td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

th.total-col, td.total-col {
    border-left: 1px solid var(--border);
    font-weight: 600;
}

tbody tr:last-child td {
    border-bottom: none;
}
