* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #f4f6f9;
    color: #1e293b;
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
}
.topbar h1 { font-size: 18px; margin: 0; color: #0f172a; }
.topbar nav a { margin-left: 16px; font-size: 14px; color: #64748b; }
.topbar nav a:hover { color: #0f172a; }

.wrap { padding: 20px; max-width: 1500px; margin: 0 auto; }

.board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    align-items: start;
}
@media (max-width: 1100px) {
    .board { grid-template-columns: 1fr; }
}

.column {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px;
    min-height: 200px;
}
.column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 6px 12px;
    border-bottom: 2px solid var(--c);
    margin-bottom: 10px;
}
.column-header h2 { font-size: 14px; margin: 0; color: #0f172a; }
.column-count {
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 999px;
}

.card {
    background: #fbfcfe;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.card:hover { border-color: #cbd5e1; }
.card-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.dot {
    width: 10px; height: 10px; border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}
.card-title { font-weight: 600; font-size: 14px; color: #0f172a; }
.card-meta { font-size: 12px; color: #64748b; margin-top: 4px; line-height: 1.5; }
.card-desc {
    font-size: 12px; color: #475569; margin-top: 6px;
    max-height: 48px; overflow: hidden; text-overflow: ellipsis;
}
.card-amount { font-size: 13px; color: #16a34a; margin-top: 6px; font-weight: 600; }
.card-actions {
    display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap;
}
.btn {
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
}
.btn:hover { background: #f1f5f9; }
.btn-primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-danger { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.btn-danger:hover { background: #fee2e2; }

.empty { color: #94a3b8; font-size: 13px; padding: 20px 6px; text-align: center; }

.add-btn {
    display: inline-block;
    margin-top: 10px;
    width: 100%;
    text-align: center;
    padding: 8px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    color: #64748b;
    font-size: 13px;
}
.add-btn:hover { border-color: #2563eb; color: #2563eb; text-decoration: none; }

/* Forms */
.form-box {
    max-width: 560px;
    margin: 30px auto;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.form-box h2 { margin-top: 0; color: #0f172a; font-size: 18px; }
.field { margin-bottom: 14px; }
.field label {
    display: block; font-size: 12px; color: #64748b; margin-bottom: 5px;
}
.field input, .field select, .field textarea {
    width: 100%;
    padding: 8px 10px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: #0f172a;
    font-size: 14px;
    font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.field textarea { min-height: 70px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; }

/* Login */
.login-wrap {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
}
.login-box {
    background: #ffffff; border: 1px solid #e2e8f0; border-radius: 10px;
    padding: 32px; width: 320px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.login-box h1 { font-size: 18px; text-align: center; color: #0f172a; }
.error { color: #dc2626; font-size: 13px; margin-top: 8px; }

/* History page */
.week-block {
    background: #ffffff; border: 1px solid #e2e8f0; border-radius: 10px;
    padding: 16px 20px; margin-bottom: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.week-block h3 { margin: 0 0 8px; font-size: 14px; color: #0f172a; }
.week-stats { display: flex; gap: 24px; flex-wrap: wrap; font-size: 13px; color: #475569; }
.week-stats b { color: #0f172a; }

table.timeline { width: 100%; border-collapse: collapse; font-size: 13px; background: #ffffff; }
table.timeline th, table.timeline td {
    text-align: left; padding: 8px 10px; border-bottom: 1px solid #e2e8f0;
}
table.timeline th { color: #64748b; font-weight: 500; }
