/* assets/style.css */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #f4f6f9;
    --surface: #ffffff;
    --primary: #2563eb;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --danger: #dc2626;
    --success: #16a34a;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,.08);
}

body { font-family: system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 16px; }

/* Login */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box { background: var(--surface); padding: 2rem; border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; max-width: 360px; }
.login-box h1 { margin-bottom: 1.5rem; font-size: 1.5rem; }
.login-box label { display: block; margin-bottom: .25rem; font-size: .875rem; color: var(--text-muted); }
.login-box input { display: block; width: 100%; padding: .5rem .75rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 1rem; margin-bottom: 1rem; }
.login-box button { width: 100%; padding: .625rem; background: var(--primary); color: #fff; border: none; border-radius: var(--radius); font-size: 1rem; cursor: pointer; }
.login-box button:hover { opacity: .9; }
.error { color: var(--danger); margin-bottom: 1rem; font-size: .875rem; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); padding: .75rem 1.5rem; display: flex; align-items: center; justify-content: space-between; }
.site-title { font-weight: 700; font-size: 1.1rem; }
.site-title a { text-decoration: none; color: var(--text); }
.site-header nav a { margin-left: 1rem; color: var(--primary); text-decoration: none; font-size: .9rem; }

/* Dashboard */
.dashboard { max-width: 900px; margin: 2rem auto; padding: 0 1rem; }
.total-wealth { margin-bottom: 2rem; }
.total-wealth h2 { font-size: 1rem; color: var(--text-muted); margin-bottom: .25rem; }
.big-number { font-size: 2.5rem; font-weight: 700; }

/* Source cards */
.sources-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.source-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; text-decoration: none; color: var(--text); display: flex; flex-direction: column; gap: .25rem; transition: box-shadow .15s; }
.source-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.source-name { font-weight: 600; }
.source-type { font-size: .75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.source-value { font-size: 1.25rem; font-weight: 700; margin-top: .5rem; }
.empty-state { color: var(--text-muted); }

/* Responsive */
@media (max-width: 480px) {
    .big-number { font-size: 1.75rem; }
    .sources-grid { grid-template-columns: 1fr 1fr; }
}

/* Detail pages */
.detail-page { max-width: 900px; margin: 2rem auto; padding: 0 1rem; }
.detail-summary { margin-bottom: 2rem; }
.detail-summary h1 { font-size: 1.5rem; margin-bottom: .25rem; }

/* Messages */
.msg { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: .9rem; }
.msg.error { background: #fee2e2; color: var(--danger); }
.msg.success { background: #dcfce7; color: var(--success); }

/* Forms */
.add-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 2rem; }
.add-form h2 { font-size: 1rem; margin-bottom: 1rem; }
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.form-row label { display: flex; flex-direction: column; gap: .25rem; font-size: .875rem; color: var(--text-muted); }
.form-row label.wide { flex: 1; min-width: 200px; }
.form-row input, .form-row select { padding: .45rem .6rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: .95rem; }
.add-form button[type=submit] { padding: .5rem 1.25rem; background: var(--primary); color: #fff; border: none; border-radius: var(--radius); cursor: pointer; font-size: .95rem; }
.add-form button[type=submit]:hover { opacity: .9; }

/* Data tables */
.tx-list h2 { margin-bottom: .75rem; font-size: 1rem; }
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th { text-align: left; padding: .5rem .75rem; border-bottom: 2px solid var(--border); color: var(--text-muted); font-weight: 600; }
.data-table td { padding: .5rem .75rem; border-bottom: 1px solid var(--border); }
.data-table tr.income td:nth-child(3) { color: var(--success); }
.data-table tr.expense td:nth-child(3) { color: var(--danger); }

/* Inline edit/delete buttons */
.tx-actions { white-space: nowrap; }
.btn-edit, .btn-delete { padding: .25rem .6rem; font-size: .8rem; border-radius: var(--radius); border: 1px solid var(--border); cursor: pointer; }
.btn-edit { background: #f1f5f9; }
.btn-delete { background: #fee2e2; color: var(--danger); border-color: #fca5a5; }
.edit-row td { background: #f8fafc; padding: .5rem .75rem; }
.edit-row input { padding: .3rem .5rem; border: 1px solid var(--border); border-radius: 4px; margin-right: .5rem; font-size: .9rem; }
.edit-row button { padding: .3rem .75rem; background: var(--primary); color: #fff; border: none; border-radius: 4px; cursor: pointer; }

/* Business project detail */
.project-summary { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-top: .5rem; font-size: .9rem; color: var(--text-muted); }
.project-actions { margin-top: 1rem; display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.btn-export { padding: .4rem 1rem; background: #1d4ed8; color: #fff; border-radius: var(--radius); text-decoration: none; font-size: .875rem; }
.btn-export:hover { opacity: .9; }
.badge-archived { font-size: .7rem; background: #f1f5f9; color: var(--text-muted); padding: .2rem .5rem; border-radius: 4px; vertical-align: middle; margin-left: .5rem; }
.big-number.negative { color: var(--danger); }
.data-table tr.payout td:nth-child(4) { color: #9333ea; }
.data-table td.negative { color: var(--danger); }

/* Daňový ticker — tlačidlá na označenie výnimky z 23% dane */
.btn-tax-apply {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
    padding: .2rem .5rem;
    font-size: .75rem;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    font-weight: 500;
}
.btn-tax-apply:hover { background: #ffedd5; }

.btn-tax-exempt {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
    padding: .2rem .5rem;
    font-size: .75rem;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    font-weight: 500;
}
.btn-tax-exempt:hover { background: #dcfce7; }

/* Daňový prehľad v detail-summary */
.tax-summary {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .875rem 1.125rem;
    margin-top: 1rem;
    font-size: .875rem;
    max-width: 380px;
}
.tax-summary h3 {
    font-size: .8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .6rem;
}
.tax-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .2rem 0;
    color: var(--text-muted);
}
.tax-row strong { color: var(--text); }
.tax-row.highlight { color: var(--danger); }
.tax-row.highlight strong { color: var(--danger); }
.tax-row.total {
    border-top: 1px solid var(--border);
    margin-top: .4rem;
    padding-top: .5rem;
    font-weight: 600;
    color: var(--text);
}
.tax-row.total strong { color: var(--text); }

/* Charts and reports */
.chart-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 2rem; }
.chart-section h2 { font-size: 1rem; margin-bottom: 1rem; }
.chart-container { position: relative; height: 280px; }

.report-summary { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }
.report-stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.5rem; flex: 1; min-width: 160px; }
.report-stat .label { display: block; font-size: .8rem; color: var(--text-muted); margin-bottom: .25rem; }
.report-stat .value { display: block; font-size: 1.3rem; font-weight: 700; }
.report-stat .value.positive { color: var(--success); }
.report-stat .value.negative { color: var(--danger); }
