* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.navbar {
    background: #1a1a2e;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    height: 60px;
    gap: 2rem;
}

.brand {
    color: #e94560;
    font-size: 1.2rem;
    font-weight: 700;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: #a0a0b8;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-link:hover {
    color: #fff;
}

.container {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    flex: 1;
    width: 100%;
}

h1 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #1a1a2e;
}

h2 {
    font-size: 1.15rem;
    margin-bottom: 1rem;
    color: #333;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.card-label {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.card-sub {
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.25rem;
}

.card-income .card-value { color: #10b981; }
.card-expense .card-value { color: #ef4444; }
.card-positive .card-value { color: #10b981; }
.card-negative .card-value { color: #ef4444; }
.card-debt .card-value { color: #f59e0b; }

.section {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.form-section {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.form-row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group select {
    padding: 0.55rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.2s;
    background: #fff;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-group-wide {
    flex: 2;
    min-width: 200px;
}

.form-group-wide input {
    width: 100%;
}

.form-group-btn {
    padding-bottom: 1px;
}

.form-hint {
    font-size: 0.7rem;
    color: #999;
    margin-top: 2px;
}

.btn {
    padding: 0.55rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-primary {
    background: #3b82f6;
    color: #fff;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-success {
    background: #10b981;
    color: #fff;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: #ef4444;
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    color: #888;
    padding: 0.75rem 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}

tbody td {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.9rem;
}

tbody tr:hover {
    background: #f9fafb;
}

.col-amount {
    font-variant-numeric: tabular-nums;
}

.col-action {
    text-align: right;
    width: 80px;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-lg {
    padding: 0.3rem 0.8rem;
    font-size: 0.85rem;
}

.badge-danger { background: #fef2f2; color: #dc2626; }
.badge-warning { background: #fffbeb; color: #d97706; }
.badge-success { background: #ecfdf5; color: #059669; }
.badge-secondary { background: #f3f4f6; color: #6b7280; }

.debt-link {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.debt-link:hover {
    text-decoration: underline;
}

.debt-detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.debt-detail-header h1 {
    margin-bottom: 0;
}

.debt-info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.info-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.info-label {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 0.35rem;
}

.info-value {
    font-size: 1.15rem;
    font-weight: 600;
}

.back-link {
    display: inline-block;
    color: #6b7280;
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.back-link:hover {
    color: #3b82f6;
}

.empty-list,
.empty-state {
    text-align: center;
    padding: 2rem;
    color: #999;
    font-size: 0.95rem;
}

.footer {
    text-align: center;
    padding: 1.5rem;
    color: #aaa;
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    .navbar {
        padding: 0 1rem;
        gap: 1rem;
    }

    .brand {
        font-size: 1rem;
    }

    .nav-links {
        gap: 0.75rem;
    }

    .nav-link {
        font-size: 0.85rem;
    }

    .container {
        padding: 0 1rem;
    }

    .form-row {
        flex-direction: column;
    }

    .form-group-wide {
        min-width: auto;
    }

    .dashboard-cards {
        grid-template-columns: 1fr 1fr;
    }
}
