:root {
    --bg: #0f172a;
    --card: #1e293b;
    --primary: #8b5cf6;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #06b6d4;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --input-bg: #0f172a;
}

/* Motyw Wysoki Kontrast */
[data-theme="contrast"] {
    --bg: #000000;
    --card: #1a1a1a;
    --primary: #ffff00;
    --success: #00ff00;
    --danger: #ff3333;
    --warning: #ffff00;
    --info: #00ffff;
    --text: #ffffff;
    --text-muted: #ffff00;
    --border: #333333;
    --input-bg: #000000;
    border: 2px solid #fff;
}

/* Motyw Faktura (Klasyczny biurowy) */
[data-theme="invoice"] {
    --bg: #f3f4f6;
    --card: #ffffff;
    --primary: #2563eb;
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;
    --info: #0891b2;
    --text: #111827;
    --text-muted: #4b5563;
    --border: #d1d5db;
    --input-bg: #ffffff;
}

/* Motyw Zeszyt */
[data-theme="notebook"] {
    --bg: #fefce8;
    --card: #ffffff;
    --primary: #1d4ed8;
    --success: #15803d;
    --danger: #b91c1c;
    --warning: #a16207;
    --info: #0e7490;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #94a3b8;
    --input-bg: #fff;
    background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Motyw Minecraft */
[data-theme="minecraft"] {
    --bg: #313131;
    --card: #4d4d4d;
    --primary: #3c8527;
    --success: #55ff55;
    --danger: #ff5555;
    --warning: #ffaa00;
    --info: #55ffff;
    --text: #ffffff;
    --text-muted: #cccccc;
    --border: #000000;
    --input-bg: #1e1e1e;
    font-family: 'Courier New', monospace;
}

/* Motyw Cyberpunk */
[data-theme="cyberpunk"] {
    --bg: #000401;
    --card: #121212;
    --primary: #fcee0a;
    --success: #00ff41;
    --danger: #ff003c;
    --warning: #00f0ff;
    --info: #00f0ff;
    --text: #fcee0a;
    --text-muted: #00f0ff;
    --border: #1e1e1e;
    --input-bg: #000;
    text-shadow: 0 0 5px rgba(252, 238, 10, 0.5);
}

/* Motyw Hello Kitty */
[data-theme="hellokitty"] {
    --bg: #ffedf5;
    --card: #ffffff;
    --primary: #ff69b4;
    --success: #ff1493;
    --danger: #e60000;
    --warning: #4a001f;
    --info: #ff69b4;
    --text: #4a001f;
    --text-muted: #8b2d56;
    --border: #ffb6c1;
    --input-bg: #fffafb;
}

/* Dodatkowe karty dla Prosumenta i Rolnika */
.card-prosument {
    background: linear-gradient(135deg, #422006 0%, #713f12 100%);
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.3);
    color: #fef08a;
    border: 1px solid #a16207;
}

.card-prosument h3 {
    color: #fef08a;
    border-bottom: 1px solid #ca8a04;
}

.card-rolnik {
    background: linear-gradient(135deg, #064e3b 0%, #14532d 100%);
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.3);
    color: #dcfce7;
    border: 1px solid #166534;
}

.card-rolnik h3 {
    color: #dcfce7;
    border-bottom: 1px solid #15803d;
}

/* Styl dla typów w rolnictwie */
.type-tag-warning {
    background: #f59e0b;
    color: black;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7em;
    text-transform: uppercase;
    font-weight: bold;
}
[data-theme="dark"] {
    --bg: #121212;
    --card: #1e1e1e;
    --primary: #bb86fc;
    --success: #03dac6;
    --danger: #cf6679;
    --warning: #ffb74d;
    --info: #2196f3;
    --text: #e0e0e0;
    --text-muted: #a0a0a0;
    --border: #333333;
    --input-bg: #2c2c2c;
}

/* Motyw Fioletowy */
[data-theme="purple"] {
    --bg: #2d1b4e;
    --card: #3d2b5e;
    --primary: #a78bfa;
    --success: #34d399;
    --danger: #fb7185;
    --warning: #fbbf24;
    --info: #38bdf8;
    --text: #f5f3ff;
    --text-muted: #c4b5fd;
    --border: #5b21b6;
    --input-bg: #2d1b4e;
}


/* Motyw Marine */
[data-theme="marine"] {
    --bg: #004d40;
    --card: #00695c;
    --primary: #4db6ac;
    --success: #81c784;
    --danger: #e57373;
    --warning: #ffb74d;
    --info: #4fc3f7;
    --text: #e0f2f1;
    --text-muted: #b2dfdb;
    --border: #00796b;
    --input-bg: #002d26;
}

/* Motyw Dark Blue */
[data-theme="darkblue"] {
    --bg: #0a192f;
    --card: #112240;
    --primary: #64ffda;
    --success: #10b981;
    --danger: #f7567c;
    --warning: #64ffda;
    --info: #00d2ff;
    --text: #ccd6f6;
    --text-muted: #8892b0;
    --border: #233554;
    --input-bg: #0a192f;
}

/* Motyw GTA San Andreas */
[data-theme="gta"] {
    --bg: #111111;
    --card: #222222;
    --primary: #2d5a27;
    --success: #3c8527;
    --danger: #9e1a1a;
    --warning: #f8c12c;
    --info: #2a75bb;
    --text: #ffffff;
    --text-muted: #aaaaaa;
    --border: #000000;
    --input-bg: #1a1a1a;
    font-family: 'Arial Black', Gadget, sans-serif;
    text-transform: uppercase;
}

/* Motyw Czerwony */
[data-theme="red"] {
    --bg: #2d0000;
    --card: #450000;
    --primary: #ff4d4d;
    --success: #00ff00;
    --danger: #ff0000;
    --warning: #ffd700;
    --info: #ffffff;
    --text: #ffffff;
    --text-muted: #ffcccc;
    --border: #660000;
    --input-bg: #1a0000;
}

/* Motyw Granatowy */
[data-theme="navy"] {
    --bg: #000080;
    --card: #0000a0;
    --primary: #ffffff;
    --success: #00ff00;
    --danger: #ff4444;
    --warning: #ffff00;
    --info: #00ffff;
    --text: #ffffff;
    --text-muted: #c0c0c0;
    --border: #ffffff;
    --input-bg: #000060;
}

/* Motyw Pastelowy */
[data-theme="pastel"] {
    --bg: #fdfcf0;
    --card: #ffffff;
    --primary: #ffb7b2;
    --success: #b2e2f2;
    --danger: #ffdac1;
    --warning: #e2f0cb;
    --info: #c7ceea;
    --text: #4a4a4a;
    --text-muted: #7d7d7d;
    --border: #d1d1d1;
    --input-bg: #ffffff;
}

/* Motyw BTS */
[data-theme="bts"] {
    --bg: #1a1a1a;
    --card: #2d2d2d;
    --primary: #bb86fc;
    --success: #34d399;
    --danger: #fb7185;
    --warning: #ffd700;
    --info: #8b5cf6;
    --text: #f5f3ff;
    --text-muted: #a78bfa;
    --border: #bb86fc;
    --input-bg: #121212;
    background-image: linear-gradient(135deg, #1a1a1a 0%, #2d1b4e 100%);
}

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    line-height: 1.5;
}
.container {
    width: 100%;
    max-width: 1000px;
    flex: 1;
}
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}
@media (min-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
    }
    .full-width {
        grid-column: 1 / -1;
    }
}
.card {
    background: var(--card);
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    transition: transform 0.2s;
}
.card:hover {
    transform: translateY(-2px);
}
h1 {
    color: var(--primary);
    text-align: center;
    letter-spacing: 2px;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
h3 {
    color: var(--text);
    margin-top: 0;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
}
.input-group {
    margin-bottom: 12px;
}
.input-label {
    display: block;
    font-size: 0.85em;
    color: var(--text-muted);
    margin-bottom: 4px;
}
input, select, button {
    width: 100%;
    padding: 12px 16px;
    margin: 4px 0;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--input-bg);
    color: var(--text);
    box-sizing: border-box;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}
input:focus, select:focus {
    border-color: var(--primary);
}
.checkbox-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 15px 0;
    justify-content: center;
}
.checkbox-item {
    display: flex;
    align-items: center;
    background: var(--border);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85em;
    cursor: pointer;
    transition: 0.2s;
    user-select: none;
}
.checkbox-item:has(input:checked) {
    background: var(--primary);
    color: white;
}
.checkbox-item input {
    display: none;
}
button {
    background: var(--primary);
    color: white;
    font-weight: 600;
    cursor: pointer;
    border: none;
    margin-top: 10px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}
button:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}
button:active {
    transform: translateY(0);
}
.item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.item:last-child {
    border-bottom: none;
}
.delete-btn {
    width: auto;
    background: none;
    color: var(--danger);
    font-size: 1.2em;
    cursor: pointer;
    margin: 0;
    padding: 8px;
    border: none;
}
.info-small {
    font-size: 0.85em;
    color: var(--text-muted);
}
#auth-screen {
    text-align: center;
    margin-top: 15vh;
}
.card-savings {
    background: linear-gradient(135deg, #065f46 0%, #064e3b 100%);
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.3);
    color: white;
    border: 1px solid #047857;
}
.card-savings h3 {
    color: white;
    border-bottom: 1px solid #059669;
}
.withdraw-btn {
    width: auto;
    background: #10b981;
    color: white;
    font-size: 0.8em;
    cursor: pointer;
    margin: 0 8px;
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: bold;
    border: none;
}
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.9em;
    font-weight: 600;
}
footer {
    text-align: center;
    padding: 30px 0;
    font-size: 0.85em;
    color: var(--text-muted);
    width: 100%;
}
.stats-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 20px;
}
@media (min-width: 480px) {
    .stats-container {
        grid-template-columns: 1fr 1fr;
    }
}
.stat-box {
    background: rgba(15, 23, 42, 0.5);
    padding: 15px;
    border-radius: 12px;
    text-align: center;
}
.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    display: block;
}
.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.form-row {
    display: flex;
    gap: 10px;
}
.form-row > * {
    flex: 1;
}
/* Mobile adjustment for forms */
@media (max-width: 480px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}
.collapsible {
    cursor: pointer;
    user-select: none;
}
.collapsible::after {
    content: ' ▼';
    font-size: 0.7em;
    float: right;
    margin-top: 5px;
}
.collapsed::after {
    content: ' ▶';
}
.content {
    display: block;
}
.collapsed + .content {
    display: none;
}
.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.color-picker-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
}
.color-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid white;
    cursor: pointer;
}
.cat-manager-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    margin-bottom: 5px;
}
.cat-tag {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
}
.type-tag {
    background: var(--border);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7em;
    text-transform: uppercase;
}
.btn-small { padding: 4px 8px; font-size: 0.8rem; border-radius: 4px; border: none; cursor: pointer; }
.btn-danger { background: var(--danger); color: white; }
