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

:root {
    --primary: #10b981;
    --primary-dark: #059669;
    --success: #34d399;
    --danger: #ef4444;
    --warning: #fbbf24;
    --bg-primary: #1a1a1a;
    --bg-secondary: #0f0f0f;
    --text-primary: #e5e7eb;
    --text-secondary: #9ca3af;
    --border: #2d2d2d;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4);
    --accent: #065f46;
    --accent-light: #064e3b;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 20px;
    background: var(--bg-primary);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

header h1 {
    font-size: 2rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.card {
    background: var(--bg-primary);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card h3 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.amount {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 16px;
}

.detail {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 8px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar.small {
    height: 6px;
    margin-top: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.accounts-section {
    margin-bottom: 40px;
}

.accounts-section h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.account-card {
    background: var(--bg-primary);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.account-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.account-header h3 {
    font-size: 1.125rem;
    color: var(--text-primary);
}

.badge {
    padding: 4px 12px;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge.success {
    background: var(--success);
}

.account-balance {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.account-detail {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.monthly-section {
    background: var(--bg-primary);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
}

.info-box {
    background: var(--accent-light);
    border-left: 4px solid var(--primary);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
}

.info-box p {
    margin-bottom: 8px;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.info-box p:last-child {
    margin-bottom: 0;
}

.info-box code {
    background: var(--bg-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    color: var(--success);
    border: 1px solid var(--border);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-danger {
    background: var(--danger);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

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

.monthly-form {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: 8px;
    margin-bottom: 24px;
}

.monthly-form h3 {
    font-size: 1.125rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

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

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.monthly-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px 20px;
    font-size: 0.875rem;
}

.month-item {
    background: var(--accent-light);
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
    border: 1px solid var(--border);
}

.month-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.month-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.month-total {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--success);
}

.month-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.month-detail-item {
    display: flex;
    justify-content: space-between;
}

.month-detail-label {
    font-weight: 500;
}

.month-detail-value {
    font-weight: 600;
    color: var(--text-primary);
}

.month-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.75rem;
    border-radius: 6px;
}

.actions-section {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.hidden {
    display: none !important;
}

.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.login-box {
    background: var(--bg-primary);
    padding: 32px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    max-width: 360px;
    width: 90%;
    text-align: center;
}

.login-box h2 {
    margin-bottom: 8px;
    color: var(--text-primary);
}

.login-box p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 20px;
}

.login-error {
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: 12px;
}

.edit-section {
    background: var(--bg-primary);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.5rem;
    }

    .amount {
        font-size: 1.5rem;
    }

    .account-balance {
        font-size: 1.5rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .actions-section {
        flex-direction: column;
    }
}
