:root {
    --bg: #ffffff;
    --text: #333333;
    --card-bg: #f9f9f9;
    --border: #e0e0e0;
    --btn-bg: #007bff;
    --btn-text: white;
    --btn-del-bg: #dc3545;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --header-bg: #ffffff;
}

[data-theme="dark"] {
    --bg: #1e1e1e;
    --text: #f0f0f0;
    --card-bg: #2d2d2d;
    --border: #444;
    --header-bg: #1a1a1a;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    padding-bottom: 60px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--header-bg);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-weight: bold;
    font-size: 1.3rem;
    text-decoration: none;
    color: var(--btn-bg);
}

#themeToggle {
    background: none;
    border: 1px solid var(--border);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    background: var(--card-bg);
}

main {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
}

h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #666;
    margin-bottom: 2rem;
}

section {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

h2 {
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
}

button {
    background: var(--btn-bg);
    color: var(--btn-text);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 1rem;
    transition: opacity 0.2s;
}

button:hover {
    opacity: 0.9;
}

#tradesList {
    min-height: 50px;
}

.trade-card {
    background: var(--bg);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
}

.trade-type.buy { color: #198754; }
.trade-type.sell { color: #dc3545; }

.delete-btn {
    background: var(--btn-del-bg);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    font-size: 0.8rem;
}

#taxSummary {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
}

footer {
    text-align: center;
    padding: 1rem;
    color: #888;
    font-size: 0.9rem;
    position: fixed;
    bottom: 0;
    width: 100%;
    background: var(--header-bg);
    box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
}

@media (max-width: 768px) {
    main {
        margin: 1rem;
        padding: 0;
    }
    section {
        padding: 1rem;
    }
    h1 {
        font-size: 1.5rem;
    }
}