/* ================================================= */
/* == ZÁKLADNÍ NASTAVENÍ A LAYOUT                 == */
/* ================================================= */
body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    color: #333;
    margin: 0;
    line-height: 1.6;
}
.kontejner {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
.header {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid #ddd;
}
.obsah {
    padding: 20px 0;
}

/* Patička */
.footer {
    text-align: center; /* Vystředí obsah */
    margin-top: 20px;
    padding: 20px 0; /* Přidán padding i nahoře, nejen border */
    border-top: 1px solid #ddd;
    font-size: 0.9em;
    color: #777; /* Výchozí barva textu patičky */
}

/* Cílíme na odstavec uvnitř patičky */
.footer p {
    margin: 0;
    padding: 0;
}

/* Cílíme na odkaz uvnitř patičky */
.footer a {
    color: #777; /* Stejná barva jako okolní text */
    text-decoration: underline; /* Podtržení pro vizuální odlišení */
    transition: color 0.2s;
}

/* Efekt při najetí myší */
.footer a:hover {
    color: #333; /* Ztmavnutí při najetí */
    text-decoration: none;
}

/* ================================================= */
/* == MENU A NAVIGACE                             == */
/* ================================================= */
.menu ul {
    list-style-type: none;
    padding: 0;
    margin: 20px 0;
    background-color: #333;
    display: flex;
    justify-content: flex-start;
}
.menu ul li a {
    color: white;
    text-decoration: none;
    padding: 14px 20px;
    display: block;
    transition: background-color 0.3s;
}
.menu ul li a:hover, .menu ul li a.active {
    background-color: #555;
}
.menu ul li.dropdown { position: relative; }
.menu ul li.dropdown .dropdown-content {
    display: none;
    position: absolute;
    background-color: #333;
    min-width: 180px; /* Lehce rozšířeno */
    z-index: 1;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
}
.menu ul li.dropdown:hover .dropdown-content { display: block; }
.menu ul li.dropdown .dropdown-content a {
    padding: 12px 16px;
    display: block;
    text-align: left;
}

/* ================================================= */
/* == TABULKY                                     == */
/* ================================================= */
table { 
    width: 100%; 
    border-collapse: collapse; 
    margin-top: 20px; 
}
th, td { 
    border: 1px solid #ddd; 
    padding: 8px; 
    text-align: left; 
    vertical-align: middle;
}
th { 
    background-color: #f2f2f2; 
    font-weight: bold;
}
tr:nth-child(even) { 
    background-color: #f9f9f9; 
}

/* Specifické úpravy tabulek */
.rocni-prehled th, .rocni-prehled td { text-align: center; padding: 6px; }
.rocni-prehled td:first-child { text-align: left; font-weight: bold; width: 10%; }
.rocni-prehled small { font-size: 11px; color: #6c757d; }
.radek-soucet td { border-top: 2px solid #333; background-color: #f8f9fa; }
#hromadne-platby-table tr { border-bottom: 1px solid #ddd; }
#hromadne-platby-table td { border-top: 1px solid #ddd; border-bottom: none; }
#hromadne-platby-table tbody tr:last-child { border-bottom: none; }

/* ================================================= */
/* == FORMULÁŘE                                   == */
/* ================================================= */
input[type="text"], 
input[type="password"], 
input[type="date"], 
input[type="number"], 
select, 
textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}
input[type="submit"] {
    background-color: #4CAF50;
    color: white;
    padding: 10px 15px;
    border: none;
    cursor: pointer;
    margin-top: 10px;
    width: 100%;
}
input[type="submit"]:hover { background-color: #45a049; }

.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}
.form-obdobi {
    display: flex;
    gap: 10px;
    align-items: center;
    background: #f8f8f8;
    padding: 10px;
    border-radius: 5px;
    width: fit-content;
}
.form-obdobi select, .form-obdobi input[type="submit"] {
    width: auto;
    margin-top: 0;
}
.platebni-formular .form-sekce {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 15px;
    border: 1px solid #eee;
    margin-bottom: 20px;
    background: #fcfcfc;
}
.platebni-formular .rozpis {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.dve-pole {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 10px;
}

/* ================================================= */
/* == KOMPONENTY A SPECIFICKÉ PRVKY               == */
/* ================================================= */
.zprava, .zprava-ok {
    padding: 10px;
    background-color: #e6ffed;
    border: 1px solid #4CAF50;
    margin-bottom: 15px;
    border-radius: 4px;
}
.zprava-chyba {
    padding: 10px;
    background-color: #ffe6e6;
    border: 1px solid #dc3545;
    margin-bottom: 15px;
    border-radius: 4px;
}

.stav-ok { color: #28a745; font-weight: bold; }
.stav-chybi { color: #dc3545; font-weight: bold; }
.stav-neutral { color: #6c757d; }
.rocni-prehled .stav-ok { background-color: #e6ffed; color: #155724; }
.rocni-prehled .stav-chybi { background-color: #ffe6e6; color: #721c24; font-weight: bold; }

.akce-buttons a.button,
.akce-buttons button.button {
    display: inline-block;
    padding: 5px 10px;
    color: white !important;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    transition: opacity 0.2s;
    border: none;
    cursor: pointer;
}
.akce-buttons a.button:hover,
.akce-buttons button.button:hover { opacity: 0.8; }
.button.edit { background-color: #007bff; }
.button.delete { background-color: #dc3545; }
.button.restore { background-color: #28a745; }

.celkova-castka {
    text-align: right; margin: 20px 0; padding: 10px;
    background-color: #f8f9fa; border: 1px solid #dee2e6; border-radius: 5px;
}
.celkova-castka strong { font-size: 1.1em; }
.celkova-castka span { font-size: 1.3em; font-weight: bold; color: #0056b3; margin-left: 15px; }

/* Hromadné platby */
.rozpis-bunka-v2 { display: flex; flex-wrap: wrap; gap: 15px; align-items: center; }
.polozka-platby-v2 { display: flex; align-items: center; gap: 5px; }
.polozka-platby-v2 label { font-size: 12px; color: #555; }
.polozka-platby-v2 input.castka-input { width: 70px; text-align: right; padding: 4px; }
.polozka-platby-v2.soucet { margin-left: auto; padding: 5px 10px; background-color: #e9ecef; border-radius: 4px; }
.polozka-platby-v2.soucet label { font-weight: bold; }
.polozka-platby-v2 span.celkova-castka-radek { font-weight: bold; font-size: 14px; }
#hromadne-platby-table .datum-platby { width: 110px; }
#hromadne-platby-table .akce-buttons { text-align: center; }

.zauctovano { font-size: 10px; color: #6c757d; cursor: help; }
.meter-note {
    margin-top: 18px;
    padding: 12px 14px;
    background-color: #f8f9fa;
    border-left: 4px solid #007bff;
}
.meter-state-panel {
    margin-top: 15px;
    padding: 16px;
    background-color: #fcfcfc;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
}
.meter-entry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    padding: 15px;
    border: 1px solid #eee;
    margin-bottom: 20px;
    background: #fcfcfc;
}

/* ================================================= */
/* == TISKOVÉ STYLY                               == */
/* ================================================= */
body.tiskovy-rezim .skryt-pri-tisku,
@media print .skryt-pri-tisku {
    display: none !important;
}

body.tiskovy-rezim .kontejner,
@media print .kontejner {
    max-width: 100%; margin: 0; padding: 0;
    box-shadow: none; border: none;
}

body.tiskovy-rezim,
@media print body {
    background-color: #fff !important;
}

@media print {
    .rocni-prehled .stav-ok,
    .rocni-prehled .stav-chybi {
        background-color: transparent !important;
        color: #000 !important;
    }
    table, td, th { font-size: 10pt; }
}

/* Layout pro stránku odečtů */
.dve-sekce-vedle-sebe {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}
.info-box {
    background-color: #f8f9fa;
}
.info-box table {
    margin-top: 0;
}
.info-box th {
    text-align: left;
    background-color: transparent;
    border: none;
    width: 40%;
}
.info-box td {
    border: none;
    font-weight: bold;
}

.platebni-pokyny {
	font-style: italic;
	background-color: #f8f9fa;
	padding: 10px;
	border-radius: 4px; 
}

/* ================================================= */
/* == STYLY PRO ROČNÍ PŘEHLED                     == */
/* ================================================= */
.rocni-prehled {
    display: flex;
    justify-content: center;
}
.rocni-prehled table {
    border: 1px solid #ddd;
    font-size: 13px;
    width: auto;
    white-space: nowrap;
}
.rocni-prehled th {
    background-color: #f8f9fa;
    font-weight: bold;
    text-align: center;
    padding: 8px 10px;
}
.rocni-prehled td {
    text-align: center;
    padding: 6px 10px;
    vertical-align: middle;
}
.rocni-prehled td:first-child {
    text-align: left;
    font-weight: bold;
}
.rocni-prehled small {
    font-size: 11px;
    color: #6c757d;
}
.rocni-prehled .stav-chybi { 
    color: #dc3545;
    font-weight: bold;
}
.rocni-prehled .stav-ok { 
    color: inherit; 
    font-weight: normal;
}

/* Tisková hlavička a pokyny */
.tiskova-hlavicka {
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}
.platebni-pokyny {
    font-style: italic;
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    margin-top: 15px;
    border: 1px solid #eee;
}
