/*
 * themoneytracker-ci4 - minimal, dependency-free styling.
 * No jQuery/Bootstrap 3 (CI3's stack was flagged as outdated in the
 * migration's dependency audit) - plain modern CSS, system font stack,
 * flexbox/grid. Same information architecture as CI3, cleaner look.
 */

:root {
    --color-bg: #f4f5f7;
    --color-surface: #ffffff;
    --color-text: #1f2430;
    --color-text-muted: #6b7280;
    --color-border: #e5e7eb;
    --color-primary: #2563eb;
    --color-positive: #16a34a;
    --color-negative: #dc2626;
    --radius: 10px;
}

* {
    box-sizing: border-box;
}

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

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

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}

.app-header .brand {
    font-weight: 700;
    font-size: 1.1rem;
}

.app-nav {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

.app-nav a {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.app-nav a:hover,
.app-nav a.active {
    color: var(--color-primary);
}

.app-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 18px;
}

.stat-card .label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: 6px;
}

.stat-card .value {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-card .value.positive {
    color: var(--color-positive);
}

.stat-card .value.negative {
    color: var(--color-negative);
}

.panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 20px;
}

.panel h2 {
    margin-top: 0;
    font-size: 1rem;
}

.category-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border);
}

.category-row:last-child {
    border-bottom: none;
}

.category-row .bar {
    flex: 1;
    height: 6px;
    background: var(--color-border);
    border-radius: 3px;
    margin: 0 14px;
    overflow: hidden;
}

.category-row .bar-fill {
    height: 100%;
    background: var(--color-primary);
}

.empty-state {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

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

.auth-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 32px;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

.auth-card h1 {
    font-size: 1.3rem;
    margin-bottom: 20px;
}

.form-field {
    margin-bottom: 16px;
}

.form-field label {
    display: block;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 6px;
}

.form-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 0.95rem;
}

.btn-primary {
    width: 100%;
    padding: 11px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
}

.page-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.page-toolbar h1 {
    font-size: 1.3rem;
    margin: 0;
}

.btn-link {
    background: var(--color-primary);
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    display: inline-block;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
}

.data-table th,
.data-table td {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.9rem;
}

.data-table th {
    color: var(--color-text-muted);
    font-weight: 600;
    background: var(--color-bg);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table .amount {
    font-weight: 600;
    text-align: right;
}

.success-message {
    background: #f0fdf4;
    color: var(--color-positive);
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.form-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 480px;
}

.form-card .btn-primary {
    width: auto;
    padding: 10px 24px;
}

.error-message {
    background: #fef2f2;
    color: var(--color-negative);
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 16px;
}
