/* Soubor: style.css | Verze: 8.0 */
/* - FEATURE: Přidány styly pro hnízděné zobrazení volných útrat (kategorie -> transakce). */
/* - FEATURE: Přidány styly pro vodorovný pruh (stacked bar) "Kdo platí". */

/* --- 1. ZÁKLADNÍ PROMĚNNÉ A RESET --- */
:root {
    --primary: #4f46e5; --primary-hover: #4338ca; --primary-light: #e0e7ff;
    --bg: #f1f5f9; --card: #ffffff;
    --text: #0f172a; --text-muted: #64748b; --text-light: #94a3b8;
    --border: #e2e8f0; --border-light: #f1f5f9;
    --positive: #10b981; --positive-bg: #d1fae5;
    --negative: #ef4444; --negative-bg: #fee2e2;
    --warning: #f59e0b;  --warning-bg: #fef3c7;
    --radius-card: 28px; --radius-btn: 20px; --radius-input: 16px;
    --shadow-soft: 0 8px 30px rgba(15, 23, 42, 0.04);
    --shadow-float: 0 20px 40px rgba(79, 70, 229, 0.15);
}

* { box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background-color: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; padding-bottom: calc(85px + env(safe-area-inset-bottom)); overflow-x: hidden; min-height: 100dvh; }

.hidden { display: none !important; }

/* --- 2. HORNÍ HLAVIČKA --- */
.top-header { position: sticky; top: 0; left: 0; width: 100%; background: rgba(241, 245, 249, 0.85); backdrop-filter: blur(16px); z-index: 1000; padding-top: env(safe-area-inset-top); border-bottom: 1px solid rgba(0,0,0,0.02); }
.header-top { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px 16px 20px; }
.logo { font-size: 1.4rem; font-weight: 800; color: var(--text); letter-spacing: -0.03em; display: flex; align-items: baseline; }
.header-actions { display: flex; gap: 12px; }

/* --- 3. PŘEPÍNAČ MĚSÍCŮ --- */
.period-selector { display: flex; justify-content: space-between; align-items: center; padding: 0 0 16px 0; font-weight: 800; font-size: 1.2rem; }
.period-selector button { background: var(--card); border: 1px solid var(--border); font-size: 1rem; cursor: pointer; padding: 8px 16px; border-radius: 100px; color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,0.02); transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); }
.period-selector button:active { background: var(--border); transform: scale(0.92); }

/* --- 4. SPODNÍ NAVIGACE --- */
.bottom-nav { position: fixed; bottom: 0; left: 0; width: 100%; background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(20px); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); z-index: 1500; box-shadow: 0 -10px 40px rgba(0,0,0,0.04); }
.tabs { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 6px 4px; }
.tab-btn { flex: 1 1 0; background: transparent; border: none; font-size: 0.65rem; font-weight: 700; color: var(--text-light); cursor: pointer; border-radius: 12px; padding: 6px 0; transition: all 0.3s; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tab-btn span.tab-icon { font-size: 1.3rem; transition: transform 0.3s; }
.tab-btn.active { color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* --- 5. KARTY A OBSAH --- */
.content { padding: 1.5rem 1rem; max-width: 800px; margin: 0 auto; }
.card { background: var(--card); border-radius: var(--radius-card); padding: 1.5rem; margin-bottom: 1.2rem; border: 1px solid rgba(0,0,0,0.02); box-shadow: var(--shadow-soft); overflow: visible; }
.card h3 { margin: 0 0 1.2rem 0; font-size: 1.15rem; color: var(--text); font-weight: 800; letter-spacing: -0.02em; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.positive { color: var(--positive); }
.negative { color: var(--negative); }
.error-blink { animation: blink-red 0.8s ease-in-out; }

@keyframes blink-red { 0%, 100% { background-color: transparent; } 50% { background-color: var(--negative-bg); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUpModal { from { transform: translateY(100%); } to { transform: translateY(0); } }

.fab-container { position: fixed; bottom: calc(75px + env(safe-area-inset-bottom)); right: 20px; z-index: 1600; }
.fab-btn { width: 60px; height: 60px; background: var(--text); color: white; border-radius: 20px; box-shadow: var(--shadow-float); font-size: 2.2rem; font-weight: 300; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; border: none; }
.fab-btn:active { transform: scale(0.9); box-shadow: 0 10px 20px rgba(79, 70, 229, 0.1); }

/* --- 6. OVERLAY A MODÁLY --- */
.overlay { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(15, 23, 42, 0.4); 
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    display: flex; justify-content: center; align-items: flex-end; 
    z-index: 2000; transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1); 
}

.auth-card { 
    background: #ffffff; padding: 2rem 1.5rem; 
    border-radius: 32px 32px 0 0; 
    width: 100%; max-width: 600px; text-align: center; 
    box-shadow: 0 -10px 40px rgba(0,0,0,0.1); 
    animation: slideUpModal 0.4s cubic-bezier(0.16, 1, 0.3, 1); 
    position: relative; max-height: 92vh; overflow-y: auto;
}

.tx-modal-card { 
    width: 100vw; height: 100dvh; max-width: none; border-radius: 0; 
    display: flex; flex-direction: column; padding: env(safe-area-inset-top) 16px 0 16px; 
    overflow: hidden; background: var(--card);
}

.tx-wrapper { display: flex; flex-direction: column; flex-grow: 1; overflow: hidden; margin-top: 0; }
.tx-scroll-area { flex-grow: 1; display: flex; flex-direction: column; justify-content: space-evenly; gap: clamp(4px, 1.5vh, 20px); overflow-y: auto; padding: 4px 2px; }
.tx-bottom-pinned { margin-top: auto; padding-top: clamp(8px, 1.5vh, 16px); padding-bottom: calc(12px + env(safe-area-inset-bottom)); background: var(--card); transition: all 0.3s ease; }

.close-modal-btn { 
    position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 15px; 
    background: var(--border-light); border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); 
    border-radius: 50%; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; 
    box-shadow: none; min-height: 0; padding: 0; transition: background 0.2s, color 0.2s; z-index: 10;
}
.close-modal-btn:active { background: #e2e8f0; color: var(--text); }

.modal-header-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0; padding-bottom: 4px; border-bottom: 1px solid var(--border-light); }
.btn-header-cancel { background: transparent; border: none; font-weight: 700; font-size: 1rem; box-shadow: none; width: auto; min-height: 0; padding: 5px 10px; margin: 0; color: var(--text-muted); }

/* --- 7. TLAČÍTKA A INPUTY --- */
button { 
    background: var(--primary); color: white; border: none; padding: 1rem; border-radius: var(--radius-btn); 
    font-weight: 800; cursor: pointer; width: 100%; min-height: 56px; font-size: 1.1rem; letter-spacing: 0.02em;
    transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s; box-shadow: 0 8px 20px rgba(79, 70, 229, 0.25);
}
button:active { transform: scale(0.96); box-shadow: 0 4px 10px rgba(79, 70, 229, 0.15); }

.btn-submit-tx { 
    background: var(--primary); color: white; font-size: clamp(1.05rem, 2vh, 1.15rem); font-weight: 900; 
    border-radius: 16px; padding: clamp(12px, 2vh, 16px); width: 100%; margin-bottom: clamp(6px, 1.5vh, 12px); 
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.25); display: flex; align-items: center; justify-content: center;
    border: none; cursor: pointer; transition: transform 0.1s, background 0.2s; min-height: 0;
}
.btn-submit-tx:active { transform: scale(0.96); box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15); }

.btn-mini { background: transparent !important; border: none !important; box-shadow: none !important; cursor: pointer; font-size: 1.3rem; padding: 8px !important; opacity: 0.5; transition: all 0.2s; width: auto !important; min-height: 0 !important; color: var(--text-muted); }
.btn-mini:active { opacity: 1; background: var(--border-light) !important; border-radius: 50%; transform: scale(0.9); }
.btn-del { color: var(--negative); }

.btn-icon { background: var(--border-light); color: var(--text); border-radius: 50%; width: 44px; height: 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center; box-shadow: none; min-height: 0; font-size: 1.3rem; transition: background 0.2s, transform 0.1s; }
.btn-icon:active { background: #e2e8f0; transform: scale(0.9); }

.btn-secondary { background: var(--border-light); color: var(--text); width: auto; font-size: 1rem; padding: 0.8rem 1.6rem; box-shadow: none; border-radius: var(--radius-btn); font-weight: 700; }
.btn-secondary:active { background: #e2e8f0; }

.btn-adjust { background: var(--primary-light); color: var(--primary); border: none; border-radius: 50%; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 1.2rem; transition: transform 0.1s; min-height: 0; padding: 0; box-shadow: none; }
.btn-adjust:active { transform: scale(0.9); }

input, select { 
    padding: clamp(0.75rem, 1.5vh, 1rem) 0.9rem; border: 2px solid transparent; border-radius: var(--radius-input); 
    width: 100%; font-size: clamp(0.9rem, 1.8vh, 1rem); background: var(--border-light); color: var(--text); 
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1); font-weight: 600; font-family: inherit; margin: 0;
}
input:focus, select:focus { outline: none; border-color: var(--primary); background: #ffffff; box-shadow: 0 0 0 4px var(--primary-light); }

#filter-cat-toggle-btn { transition: all 0.2s; }
#filter-cat-toggle-btn.open { border-color: var(--primary); background: #ffffff; box-shadow: 0 0 0 4px var(--primary-light); color: var(--primary); }
#filter-cat-dropdown { animation: fadeUp 0.2s ease-out; box-shadow: var(--shadow-soft); }

.form-inline { display: grid; grid-template-columns: 1fr; gap: 1.2rem; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } 

/* --- 8. ZMENŠENÝ NUMPAD A PILULKY V MODÁLU --- */
.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(6px, 1.2vh, 10px); padding-bottom: 0; }
.numpad-btn { background: var(--border-light); color: var(--text); font-size: clamp(1.2rem, 2.5vh, 1.4rem); font-weight: 600; border: none; border-radius: 14px; padding: clamp(8px, 1.8vh, 14px) 0; cursor: pointer; box-shadow: none; transition: background 0.1s, transform 0.1s; }
.numpad-btn:active { background: #e2e8f0; transform: scale(0.95); }
.numpad-btn.btn-action { color: var(--primary); font-weight: 800; }
.numpad-btn.btn-del { color: var(--negative); font-size: clamp(1.4rem, 2.8vh, 1.6rem); }

.amount-display { font-size: clamp(2.4rem, 5vh, 3.2rem); font-weight: 900; text-align: center; padding: 0; color: var(--text); border-bottom: 2px solid var(--border-light); margin-bottom: 2px; letter-spacing: -0.05em; min-height: clamp(42px, 6vh, 55px); transition: color 0.3s; }
.amount-display.empty { color: var(--text-light); }

.quick-cats { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; overflow-y: auto; max-height: 26vh; padding-bottom: 6px; margin-bottom: 2px; -webkit-overflow-scrolling: touch; }
.quick-cats::-webkit-scrollbar { display: none; } 

.cat-chip { background: var(--border-light); color: var(--text-muted); padding: clamp(6px, 1vh, 8px) 14px; border-radius: 100px; font-size: clamp(0.85rem, 1.6vh, 0.95rem); font-weight: 700; cursor: pointer; transition: all 0.2s; border: 2px solid transparent; white-space: nowrap; }
.cat-chip.selected { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.pill-group-label { display: block; font-weight: 800; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; margin-top: 2px; text-align: center; }

.type-switch-container { display: flex; background: var(--border-light); border-radius: 100px; padding: 4px; margin-bottom: 2px; }
.btn-type { flex: 1; text-align: center; padding: clamp(6px, 1.2vh, 10px) 0; border-radius: 100px; font-weight: 800; font-size: clamp(0.85rem, 1.6vh, 0.95rem); color: var(--text-muted); cursor: pointer; transition: all 0.3s; }
.btn-type.active.btn-expense { background: var(--card); color: var(--negative); box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.btn-type.active.btn-income { background: var(--card); color: var(--positive); box-shadow: 0 4px 12px rgba(0,0,0,0.05); }

/* --- 9. DATA KARTY A SEZNAMY (TRANSAKCE) --- */
.data-grid { display: flex; flex-direction: column; gap: 14px; }
.data-card { 
    background: #ffffff; border: 1px solid rgba(0,0,0,0.03); 
    border-radius: 20px; padding: 18px; 
    display: grid; grid-template-columns: 1fr auto; 
    align-items: center; gap: 14px; transition: transform 0.1s, background 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}
#grid-transactions .data-card { grid-template-columns: 32px 1fr auto; }

.data-card:active { transform: scale(0.97); background: #f8fafc; }
.dc-col-check { display: flex; align-items: center; justify-content: center; }
.tx-checkbox { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--border); accent-color: var(--primary); }
.dc-col-info { display: flex; flex-direction: column; min-width: 0; }
.dc-row-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px;}
.dc-cat { font-weight: 800; font-size: 1.1rem; color: var(--text); letter-spacing: -0.01em; }
.dc-date { font-size: 0.75rem; color: var(--text-muted); background: var(--border-light); padding: 4px 10px; border-radius: 100px; font-weight: 700; white-space: nowrap; }
.dc-note { font-size: 0.95rem; color: var(--text-muted); white-space: normal; word-break: break-word; line-height: 1.5; font-weight: 500; }
.dc-meta-badges { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.meta-badge { font-size: 0.75rem; font-weight: 700; padding: 3px 8px; border-radius: 8px; background: #ffffff; color: var(--text-muted); border: 1px solid var(--border); }
.dc-col-right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.dc-amount { font-weight: 900; font-size: 1.25rem; white-space: nowrap; letter-spacing: -0.02em; }
.dc-actions { display: flex; gap: 4px; }
.tx-group-header { font-size: 0.9rem; font-weight: 800; color: var(--text-light); margin: 24px 0 12px 5px; text-transform: uppercase; letter-spacing: 0.08em; display: flex; align-items: center; gap: 16px; }
.tx-group-header::after { content: ''; flex-grow: 1; height: 1px; background: var(--border); }
.pagination-container { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; padding-top: 24px; border-top: 1px dashed var(--border); }

/* --- HNÍZDĚNÉ SEZNAMY VOLNÝCH ÚTRAT --- */
.unbudgeted-cat-group { margin-bottom: 8px; border-radius: 16px; background: var(--border-light); overflow: hidden; transition: all 0.2s; border: 1px solid transparent; }
.unbudgeted-cat-group.open { background: #ffffff; border-color: var(--border); box-shadow: 0 4px 12px rgba(0,0,0,0.03); }
.unbudgeted-cat-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; cursor: pointer; transition: background 0.2s; }
.unbudgeted-cat-header:active { background: #e2e8f0; }
.unbudgeted-cat-title { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--text); font-size: 1rem; }
.unbudgeted-cat-dot { display: inline-block; width: 14px; height: 14px; border-radius: 5px; }
.unbudgeted-cat-amount { font-weight: 900; font-size: 1.05rem; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }
.unbudgeted-toggle-icon { font-size: 0.8rem; color: var(--text-light); transition: transform 0.2s; }
.unbudgeted-cat-group.open .unbudgeted-toggle-icon { transform: rotate(180deg); }

.unbudgeted-tx-list { padding: 4px 16px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.unbudgeted-tx-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; background: #f8fafc; border-radius: 12px; border-left: 4px solid var(--border); }
.unbudgeted-tx-info { display: flex; flex-direction: column; gap: 2px; }
.unbudgeted-tx-date { font-size: 0.75rem; font-weight: 800; color: var(--text-light); text-transform: uppercase; }
.unbudgeted-tx-note { font-size: 0.9rem; font-weight: 600; color: var(--text-muted); }
.unbudgeted-tx-amount { font-size: 1rem; font-weight: 800; color: var(--negative); }

/* --- NOVÉ: UKAZATEL PLÁTCŮ (WHO BAR) --- */
.who-bar-segment { height: 100%; transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.who-legend-item { display: flex; align-items: center; gap: 4px; }


/* --- 10. SRDCE DASHBOARD (FINANČNÍ ZDRAVÍ) --- */
.heart-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 28px; }
.heart-card { background: var(--card); border: 1px solid rgba(0,0,0,0.02); border-radius: var(--radius-card); padding: 1.8rem 1rem; text-align: center; box-shadow: var(--shadow-soft); display: flex; flex-direction: column; align-items: center; justify-content: center; transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1); }
.heart-card:active { transform: scale(0.97); }
.heart-icon { font-size: 1.8rem; margin-bottom: 14px; background: var(--border-light); width: 56px; height: 56px; border-radius: 20px; display: flex; align-items: center; justify-content: center; }
.heart-value { font-size: 1.6rem; font-weight: 900; color: var(--text); line-height: 1.2; margin-bottom: 6px; letter-spacing: -0.03em; }
.heart-label { font-size: 0.9rem; color: var(--text-muted); font-weight: 800; }
.heart-sub { font-size: 0.8rem; color: var(--text-light); margin-top: 6px; font-weight: 600; }

.hc-green .heart-icon { color: var(--positive); background: var(--positive-bg); } 
.hc-green .heart-value { color: var(--positive); }
.hc-blue .heart-icon { color: var(--primary); background: var(--primary-light); } 
.hc-blue .heart-value { color: var(--primary); }
.hc-orange .heart-icon { color: var(--warning); background: var(--warning-bg); } 
.hc-orange .heart-value { color: var(--warning); }
.hc-cushion .heart-icon { color: #8b5cf6; background: #ede9fe; } 
.hc-cushion .heart-value { color: #8b5cf6; }

.hc-crisis { background: var(--crisis-bg); border: 2px solid var(--crisis-border); position: relative; overflow: hidden; }
.hc-crisis .heart-icon { background: #fee2e2; color: var(--negative); animation: pulse-red 2s infinite cubic-bezier(0.4, 0, 0.2, 1); }
.hc-crisis .heart-value, .hc-crisis .heart-label, .hc-crisis .heart-sub { color: var(--negative); }
@keyframes pulse-red { 0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); } 70% { transform: scale(1.15); box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); } 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }

/* --- 11. DASHBOARD STATISTIKY A RENTGEN --- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 1.8rem; }
.amount { font-size: 2.4rem; font-weight: 900; margin: 10px 0 14px 0; line-height: 1; letter-spacing: -0.04em; color: var(--text); }
.runway-health-container { margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--border); }
.health-row { display: flex; align-items: center; margin-bottom: 12px; }
.health-label { width: 65px; font-size: 0.9rem; color: var(--text-muted); font-weight: 800; }
.health-track { flex-grow: 1; height: 12px; background: var(--border-light); border-radius: 6px; overflow: hidden; }
.health-fill { height: 100%; border-radius: 6px; transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1); }

.xray-container { margin-top: 1.8rem; padding-top: 1.8rem; border-top: 1px dashed var(--border); }
.xray-track { display: flex; height: 36px; background: var(--border-light); border-radius: 12px; overflow: hidden; margin-bottom: 18px; box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);}
.xray-segment { height: 100%; display: flex; align-items: center; justify-content: center; color: white; font-size: 0.85rem; font-weight: 800; transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1); position: relative; }
.seg-pending { background: #94a3b8; } .seg-budget { background: #f59e0b; } .seg-free { background: #10b981; } .seg-deficit { background: repeating-linear-gradient(45deg, #ef4444, #ef4444 10px, #dc2626 10px, #dc2626 20px); }
.xray-legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 0.9rem; color: var(--text-muted); justify-content: center; font-weight: 700;}
.xray-legend-item { display: flex; align-items: center; gap: 8px; }
.dot { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.xray-value { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-shadow: 0 1px 3px rgba(0,0,0,0.3); }

/* Smart Features */
.smart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.4rem; margin-top: 1.2rem; }
.cat-health-item { margin-bottom: 18px; }
.cat-health-header { display: flex; justify-content: space-between; align-items: center; font-size: 1rem; margin-bottom: 10px; font-weight: 800; color: var(--text); }
.cat-health-track { height: 16px; background: var(--border-light); border-radius: 8px; position: relative; overflow: visible; }
.cat-health-fill { height: 100%; border-radius: 8px; transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1); min-width: 8px; }
.cat-health-avg-marker { position: absolute; top: -6px; bottom: -6px; width: 4px; background: var(--text); border-radius: 2px; z-index: 5; opacity: 0.8; pointer-events: none; }
.cat-health-meta { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--text-muted); margin-top: 8px; font-weight: 700;}
.health-ok { background: var(--positive); } .health-warn { background: var(--warning); } .health-crit { background: var(--negative); }

/* --- 12. GRAFY --- */
.chart-container { position: relative; width: 100%; overflow: hidden; margin-top: 15px; }
.chart-container canvas { width: 100% !important; height: 100% !important; }

/* --- 13. ROZPOČTY A CHECKBOXY --- */
.budget-item { margin-bottom: 1.4rem; }
.budget-header { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 1rem; font-weight: 800; }
.progress-track { display: flex; background: var(--border-light); height: 14px; border-radius: 7px; overflow: hidden; position: relative; }
.progress-fill { height: 100%; transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.progress-cannibalized { height: 100%; background: repeating-linear-gradient(45deg, rgba(239, 68, 68, 0.8), rgba(239, 68, 68, 0.8) 8px, rgba(220, 38, 38, 0.9) 8px, rgba(220, 38, 38, 0.9) 16px); transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.bg-green { background: var(--prog-green); } .bg-orange { background: var(--prog-orange); } .bg-red { background: var(--prog-red); }
.bg-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.bg-priority-badge { font-size: 0.8rem; font-weight: 800; background: var(--border-light); color: var(--text-muted); padding: 4px 10px; border-radius: 100px; display: inline-flex; align-items: center; gap: 4px; }
.bg-cannibalized-badge { font-size: 0.8rem; font-weight: 800; background: var(--negative-bg); color: var(--negative); padding: 4px 10px; border-radius: 100px; }
.bg-drawdown-info { font-size: 0.85rem; color: var(--text-muted); font-weight: 700; }

.checkbox-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.checkbox-item { display: flex; align-items: center; gap: 14px; padding: 14px 12px; background: var(--border-light); border-radius: 16px; cursor: pointer; transition: background 0.2s cubic-bezier(0.4, 0, 0.2, 1);}
.checkbox-item:active { background: #e2e8f0; transform: scale(0.98); }
.checkbox-item input { width: 24px; height: 24px; margin: 0; cursor: pointer; accent-color: var(--primary); }

/* --- 14. GLOBÁLNÍ TOOLTIP --- */
.tooltip-trigger { cursor: pointer; margin-left: 6px; color: var(--primary); font-size: 1.1rem; vertical-align: middle; }
#global-tooltip { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -45%) scale(0.95); width: 90%; max-width: 380px; background-color: rgba(15, 23, 42, 0.95); color: #fff; padding: 24px; border-radius: 24px; z-index: 20000; text-align: left; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5); opacity: 0; visibility: hidden; transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); pointer-events: none; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
#global-tooltip.visible { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); pointer-events: auto; }
#global-tooltip h4 { margin: 0 0 12px 0; color: #fff; font-size: 1.2rem; font-weight: 800; }
#tooltip-backdrop { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 19999; display: none; background: rgba(0,0,0,0.25); }
#tooltip-backdrop.active { display: block; }

/* --- 15. KALENDÁŘ A OSTATNÍ --- */
.calendar-header-row { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-weight: 800; padding-bottom: 16px; font-size: 0.9rem; color: var(--text-muted); text-transform: uppercase;}
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin-top: 10px; }
.cal-day { background: var(--border-light); border-radius: 16px; min-height: 65px; padding: 8px; display: flex; flex-direction: column; align-items: center; cursor: pointer; transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s;}
.cal-day:active { transform: scale(0.92); background: #e2e8f0; }
.cal-day.today { background: var(--primary); color: white; box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3); }
.cal-day.today .day-number { color: white; }
.cal-day.empty { background: transparent; pointer-events: none; }
.day-number { font-size: 1rem; font-weight: 800; margin-bottom: 8px; color: var(--text); }
.cal-markers { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; width: 100%; }
.cal-dot { width: 8px; height: 8px; border-radius: 50%; }
.cal-dot.inc { background: var(--positive); } .cal-dot.exp { background: var(--negative); } .cal-dot.pending { opacity: 0.5; border: 1.5px solid rgba(0,0,0,0.4); }
.cal-day.today .cal-dot { border: 1.5px solid white; }

.settings-group { margin-bottom: 28px; }
.settings-group h4 { margin-bottom: 14px; font-size: 0.95rem; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.05em; font-weight: 800; }

/* --- 16. DESKTOP A RESPONZIVITA --- */
@media (max-width: 800px) {
    :root { --radius-card: 24px; }
    .heart-grid { gap: 12px; }
    .heart-card { padding: 1.5rem 1rem; }
    .heart-value { font-size: 1.4rem; }
    .amount { font-size: 2rem; }
    .data-card { padding: 16px 12px; gap: 10px; }
    .dc-cat { font-size: 1rem; }
    .dc-amount { font-size: 1.1rem; }
}

@media (min-width: 801px) {
    body { padding-bottom: 0; }
    .top-header { width: calc(100% - 120px); left: 120px; }
    .content { margin-left: 120px; max-width: 900px; padding-top: 2.5rem; padding-bottom: 2.5rem; }
    .bottom-nav { top: 0; left: 0; bottom: 0; width: 120px; height: 100dvh; border-top: none; border-right: 1px solid var(--border); border-radius: 0; padding-top: 80px; background: rgba(255, 255, 255, 0.98); box-shadow: 4px 0 20px rgba(0,0,0,0.02); }
    .tabs { flex-direction: column; padding: 20px 10px; gap: 15px; justify-content: flex-start; }
    .tab-btn { width: 100%; padding: 16px 0; border-radius: 18px; }
    .tab-btn span.tab-icon { font-size: 1.6rem; }
    .fab-container { bottom: 40px; right: 40px; }
}
