/* --- MODERNÍ REDESIGN PRO STATISTIKY (HEATMAP) --- */

/* --- HLAVIČKA A FILTR --- */
.page-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
}
.page-header h1 {
    margin: 0;
}
.page-header select {
    background-color: #3a3a3c;
    color: #f5f5f5;
    border: 1px solid #555;
    border-radius: 6px;
    padding: 12px 15px;
    font-size: 1em;
    cursor: pointer;
}
/* Styly pro PDF tlačítka v hlavičce */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}
.btn-pdf {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background-color: #c0392b;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 600;
    transition: background-color 0.2s;
}
.btn-pdf:hover {
    background-color: #e74c3c;
}


/* --- KARTY PRO SOUHRN NAD TABULKOU --- */
.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}
.summary-card {
    background-color: #2a2a2e;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #3a3a3c;
}
.summary-card .label {
    font-size: 0.9em;
    color: #a0a0a0;
    margin-bottom: 8px;
}
.summary-card .value {
    font-size: 1.8em;
    font-weight: bold;
}
.prijem { color: #2ecc71; }
.vydaj { color: #e74c3c; }

/* --- NOVÁ HEATMAP TABULKA --- */
.heatmap-container {
    background-color: #2a2a2e;
    border-radius: 12px;
    border: 1px solid #3a3a3c;
    padding: 10px;
    overflow-x: auto;
}
.heatmap-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 5px; /* Mezery mezi buňkami */
    min-width: 1000px;
}
.heatmap-table th, .heatmap-table td {
    padding: 12px;
    text-align: right;
    border-radius: 6px;
    vertical-align: middle;
}
.heatmap-table thead th {
    background-color: transparent;
    font-size: 0.9em;
    color: #a0a0a0;
    font-weight: 600;
    text-align: center;
}
.heatmap-table tbody th {
    text-align: left;
    background-color: #333336;
    color: #f5f5f5;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s;
    white-space: nowrap;
}
.heatmap-table tbody th:hover {
    background-color: #4a90e2;
}
.heatmap-table tfoot th, .heatmap-table tfoot td {
    background-color: #1c1c1e;
    font-weight: bold;
    color: #f5f5f5;
}
/* Styly pro buňky s hodnotami */
.value-cell {
    cursor: pointer;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s;
}
.value-cell:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    z-index: 10;
    position: relative;
}
.value-cell .total {
    font-weight: 700;
    display: block;
    color: #f5f5f5;
}
.value-cell .split {
    font-size: 0.8em;
    color: #a0a0a0;
    margin-top: 4px;
}
.account-label {
    display: inline-block; padding: 2px 4px; border-radius: 3px;
    font-size: 0.7em; margin-right: 4px; color: #fff;
}
.account-label.cs { background-color: #3498db; }
.account-label.mbank { background-color: #c0392b; }

/* --- VYLEPŠENÉ MODÁLNÍ OKNO --- */
.modal-backdrop { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.75); backdrop-filter: blur(5px); z-index: 100; display: flex; justify-content: center; align-items: center; opacity: 0; visibility: hidden; transition: opacity 0.3s ease; }
.modal-backdrop.visible { opacity: 1; visibility: visible; }
.modal-content { background-color: #2a2a2e; border: 1px solid #3a3a3c; border-radius: 12px; padding: 25px; width: 90%; max-width: 900px; max-height: 85vh; display: flex; flex-direction: column; transform: translateY(20px); transition: transform 0.3s ease; }
.modal-backdrop.visible .modal-content { transform: translateY(0); }
.modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #3a3a3c; padding-bottom: 15px; margin-bottom: 20px; }
.modal-header h2 { margin: 0; }
.modal-close-btn { background: none; border: none; color: #a0a0a0; font-size: 1.8em; cursor: pointer; transition: color 0.2s, transform 0.2s; line-height: 1; }
.modal-close-btn:hover { color: #fff; transform: scale(1.1); }
.modal-body { overflow-y: auto; }
.modal-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding: 20px; background-color: #1c1c1e; border-radius: 8px; margin-bottom: 25px; }
.summary-item { text-align: center; }
.summary-item span { display: block; color: #a0a0a0; font-size: 0.9em; margin-bottom: 5px; }
.summary-item strong { font-size: 1.6em; font-weight: bold; }
.summary-item.prijem strong { color: #2ecc71; } .summary-item.vydaj strong { color: #e74c3c; } .summary-item.bilance strong { color: #4a90e2; }
.modal-body-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.transaction-column h3 { margin-top: 0; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px solid #3a3a3c; }
.no-results-modal { text-align: center; color: #a0a0a0; padding: 30px 0; }
.transaction-item { display: flex; align-items: center; margin-bottom: 15px; }
.transaction-icon { width: 40px; height: 40px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #fff; margin-right: 15px; flex-shrink: 0; }
.transaction-icon.prijem { background-color: rgba(46, 204, 113, 0.2); color: #2ecc71; }
.transaction-icon.vydaj { background-color: rgba(231, 76, 60, 0.2); color: #e74c3c; }
.transaction-details { flex-grow: 1; }
.transaction-details strong { display: block; color: #f5f5f5; }
.transaction-details small { color: #a0a0a0; font-size: 0.85em; }
.transaction-amount { font-weight: bold; font-size: 1.1em; white-space: nowrap; }
.transaction-amount.prijem { color: #2ecc71; } .transaction-amount.vydaj { color: #e74c3c; }
.pdf-icon { color: #a0a0a0; text-decoration: none; font-size: 1.2em; transition: color 0.2s; }
.pdf-icon:hover { color: #c0392b; }

/* RESPONZIVNÍ ÚPRAVY */
@media (max-width: 768px) {
    .page-header { flex-direction: column; align-items: stretch; }
    .stats-summary { grid-template-columns: 1fr; }
    .modal-body-grid { grid-template-columns: 1fr; }
}