/*
 * Optimalizácia – CSS
 */


/* ==========================================================================
   FILTRE A FORMULÁRE
   ========================================================================== */

.filters {
    margin: 16px 0 20px;
}

.date-filter-row {
    display: flex;
    gap: 16px;
    align-items: end;
    flex-wrap: wrap;
}

.date-filter-item {
    min-width: 220px;
}

.date-filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-row {
    display: flex;
    gap: 16px;
    align-items: end;
    flex-wrap: wrap;
}

.filter-row select,
.filter-row button {
    padding: 8px 10px;
}

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.model-filter-row {
    display: flex;
    gap: 16px;
    align-items: end;
    flex-wrap: wrap;
}

.model-filter-item {
    min-width: 220px;
}

.battery-filter-row {
    display: flex;
    gap: 16px;
    align-items: end;
    flex-wrap: wrap;
}

.battery-filter-item {
    flex: 1 1 220px;
    min-width: 220px;
}

.battery-filter-actions {
    display: flex;
    align-items: end;
}

.date-mask {
    min-width: 160px;
}

/* ==========================================================================
   GRAFY A VIZUALIZÁCIE
   ========================================================================== */

.chart-wrap {
    position: relative;
    height: 500px;
    max-width: 100%;
}

/* ==========================================================================
   SUMMARY KARTY (Starý layout)
   ========================================================================== */

.summary-cards {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin: 16px 0 20px;
}

.summary-card {
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    padding: 12px 16px;
    min-width: 180px;
    background: #fafafa;
}

.summary-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
}

.summary-value {
    font-size: 22px;
    font-weight: bold;
}

/* ==========================================================================
   TARIFOVÉ TABUĽKY (Starý layout)
   ========================================================================== */

.tarif-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

.tarif-table-card {
    padding: 16px 18px;
    background: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
}

.tarif-table-title {
    font-size: 18px;
    color: #222;
    margin-bottom: 12px;
}

.tarif-table {
    width: 100%;
    border-collapse: collapse;
}

.tarif-table tr + tr td {
    border-top: 1px solid #ececec;
}

.tarif-table td {
    padding: 10px 0;
    vertical-align: middle;
}

.tarif-price-cell {
    text-align: right;
    font-weight: 700;
    white-space: nowrap;
}



/* ==========================================================================
   POROVNÁVACIE TABUĽKY — NOVÝ LAYOUT
   ========================================================================== */

.tarif-compare-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

/* Energy headline row */
.tarif-compare-table thead tr.energy-headline-row th {
    padding: 0.8rem 1rem;
    vertical-align: middle;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e5e7eb;
}

.energy-row-label {
    font-size: 0.92rem;
    font-weight: 700;
    color: #374151;
}

.energy-value-wrap {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.15rem;
}

.energy-value {
    font-size: 1.28rem;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.energy-unit {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.72;
}

/* Column header row */
.tarif-compare-table thead tr.column-header-row th {
    padding: 0.8rem 1rem;
    vertical-align: middle;
    background: #fff;
    border-bottom: 1px solid #eef2f7;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
}

.tarif-compare-table thead tr.column-header-row th:first-child {
    text-align: left;
}

.tarif-compare-table thead tr.column-header-row th:not(:first-child) {
    text-align: right;
}

.tarif-compare-table tbody td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.tarif-compare-table tbody tr:last-child td {
    border-bottom: none;
}

.tarif-compare-table tbody td:first-child {
    text-align: left;
    color: #374151;
    font-weight: 600;
}

.tarif-compare-table tbody td:not(:first-child) {
    text-align: right;
}

/* ==========================================================================
   FARBY A FAREBNÉ KÓDOVANIE (spoločné aj nové)
   ========================================================================== */

/* Základné hodnoty */
.actual-value {
    color: #111827;
    font-weight: 600;
}

.model-value {
    color: #4338ca;
    font-weight: 700;
    background: rgba(79, 70, 229, 0.08);
    border-radius: 8px;
}

.diff-value {
    font-weight: 700;
    border-radius: 8px;
}

.diff-positive {
    color: #15803d;
    background: rgba(22, 163, 74, 0.10);
}

.diff-negative {
    color: #b91c1c;
    background: rgba(220, 38, 38, 0.10);
}

.diff-neutral {
    color: #6b7280;
    background: rgba(107, 114, 128, 0.10);
}

/* Karty a sekcie */
.energy-section-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.energy-card-header {
    padding: 1rem 1.25rem 0.85rem;
    border-bottom: 1px solid #eef2f7;
    background: #fff;
}

.energy-card-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
}

/* large kWh values */
.actual-big,
.model-big,
.diff-big {
    font-size: 1.2rem;
    line-height: 1.2;
    font-weight: 800;
}

/* starý headline-row (ak by si chcel zachovať aj starý layout) */
.headline-row {
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.95), rgba(241, 245, 249, 0.95));
}

.headline-row td {
    padding-top: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.headline-label {
    font-weight: 700;
    color: #374151;
}

/* položka „Dopad“ / „Impact“ – ak ju požívaš */
.impact-card {
    background: linear-gradient(180deg, rgba(14, 165, 233, 0.04), rgba(79, 70, 229, 0.04));
    border: 1px solid rgba(79, 70, 229, 0.10);
}

.impact-value {
    font-size: 1.05rem;
}

/* ── Simulation stats tab ─────────────────────────────── */
.sim-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--color-text-muted, #888);
    margin: 24px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border, #e0e0e0);
}

/* KPI grid */
.sim-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 8px;
}
.sim-kpi {
    background: var(--color-surface, #fff);
    border: 1px solid var(--color-border, #e0e0e0);
    border-radius: 10px;
    padding: 14px 16px;
    border-top: 3px solid currentColor;
}
.sim-kpi--green  { color: #2e7d32; }
.sim-kpi--blue   { color: #1565c0; }
.sim-kpi--orange { color: #e65100; }
.sim-kpi--purple { color: #6a1b9a; }
.sim-kpi--teal   { color: #00695c; }
.sim-kpi--red    { color: #c62828; }
.sim-kpi--yellow { color: #f57f17; }
.sim-kpi--gray   { color: #37474f; }
.sim-kpi__label  { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; opacity: .7; margin-bottom: 4px; }
.sim-kpi__value  { font-size: 24px; font-weight: 700; line-height: 1; color: var(--color-text, #222); }
.sim-kpi__value span { font-size: 13px; font-weight: 400; opacity: .6; }
.sim-kpi__sub    { font-size: 11px; opacity: .55; margin-top: 3px; color: var(--color-text, #222); }

/* Flow grid */
.sim-flow-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 8px;
}
.sim-flow-card {
    background: var(--color-surface, #fff);
    border: 1px solid var(--color-border, #e0e0e0);
    border-radius: 10px;
    padding: 16px 18px;
}
.sim-flow-card__title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 14px;
    color: var(--color-text, #222);
}
.sim-flow-card__title small {
    font-weight: 400;
    opacity: .55;
    font-size: 11px;
    margin-left: 6px;
}

/* Progress bary */
.sim-progress-list { display: flex; flex-direction: column; gap: 10px; }
.sim-prog__header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    font-size: 12px;
}
.sim-prog__dot  { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.sim-prog__label { flex: 1; color: var(--color-text, #222); }
.sim-prog__val  { color: var(--color-text-muted, #888); }
.sim-prog__pct  { min-width: 44px; text-align: right; font-weight: 600; color: var(--color-text, #222); }
.sim-prog__bar  { height: 5px; background: var(--color-border, #e0e0e0); border-radius: 3px; overflow: hidden; }
.sim-prog__fill { height: 100%; border-radius: 3px; transition: width .4s ease; }

@media (max-width: 640px) {
    .sim-kpi-grid  { grid-template-columns: repeat(2, 1fr); }
    .sim-flow-grid { grid-template-columns: 1fr; }
}

/* ================================================
   Sign formuláre – Bootstrap 5 override
   Pridaj do svojho globálneho CSS (napr. app.css)
   ================================================ */

/* Primárna farba = teal z portálu */
:root {
    --sign-primary: #4f98a3;
    --sign-primary-dark: #2c6e77;
    --sign-primary-light: #e8f4f6;
}

/* ── Inputy ── */
.sign-form .form-control,
.sign-form .form-select {
    border-radius: .5rem;
    border-color: #dee2e6;
    padding: .55rem .85rem;
    font-size: .925rem;
    transition: border-color .15s, box-shadow .15s;
}

.sign-form .form-control:focus,
.sign-form .form-select:focus {
    border-color: var(--sign-primary);
    box-shadow: 0 0 0 .2rem rgba(79,152,163,.2);
}

/* ── Label ── */
.sign-form .form-label {
    font-size: .875rem;
    font-weight: 600;
    margin-bottom: .3rem;
    color: #344054;
}

/* ── Submit tlačidlo ── */
.sign-form .btn-primary {
    background: linear-gradient(135deg, var(--sign-primary), var(--sign-primary-dark));
    border: none;
    border-radius: .5rem;
    padding: .6rem 1.25rem;
    font-weight: 600;
    font-size: .925rem;
    transition: opacity .15s, transform .1s;
}

.sign-form .btn-primary:hover {
    opacity: .92;
    transform: translateY(-1px);
    background: linear-gradient(135deg, var(--sign-primary), var(--sign-primary-dark));
    border: none;
}

.sign-form .btn-primary:active {
    transform: translateY(0);
}

/* ── Chybové hlášky ── */
.sign-form .invalid-feedback,
.sign-form .form-error {
    font-size: .8rem;
    color: #dc3545;
}

/* ── Checkbox (zapamätať) ── */
.sign-form .form-check-input:checked {
    background-color: var(--sign-primary);
    border-color: var(--sign-primary);
}

.sign-form .form-check-label {
    font-size: .875rem;
    color: #4b5563;
}

/* ── Karta ── */
.card.rounded-4 {
    border-radius: .875rem !important;
}

/* ── Info box s cenou ── */
.sign-price-info {
    background: var(--sign-primary-light);
    border: 1px solid rgba(79,152,163,.3);
    border-radius: .5rem;
    font-size: .85rem;
    padding: .6rem .85rem;
    color: #2c6e77;
}