/* --- GLOBÁLNÍ NASTAVENÍ (Tmavý režim) --- */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    background-color: #1a202c; /* Tmavé pozadí */
    color: #e2e8f0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
}

a { text-decoration: none; }

/* --- HORNÍ LIŠTA --- */
.header-top {
    background-color: #2d3748;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #4a5568;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.logo-link {
    color: #4299e1;
    font-weight: bold;
    font-size: 1.4em;
    letter-spacing: 0.5px;
}

/* --- NAVIGACE --- */
.nav-section {
    background-color: #2d3748;
    padding: 12px 0;
    border-bottom: 1px solid #4a5568;
    margin-bottom: 30px;
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 10px;
}

.nav-btn {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 500;
    color: #a0aec0;
    background-color: rgba(255,255,255,0.05);
    font-size: 0.9em;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.nav-btn:hover {
    background-color: #4a5568;
    color: white;
    transform: translateY(-1px);
}

/* Aktivní tlačítko svítí */
.nav-btn.active {
    background-color: #4299e1;
    color: white;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(66, 153, 225, 0.4);
    border-color: #4299e1;
}

/* Speciální barva pro aktivní Návod (oranžová) */
.nav-btn.active.nav-help {
    background-color: #ed8936;
    border-color: #ed8936;
    box-shadow: 0 0 10px rgba(237, 137, 54, 0.4);
}

/* --- ROZLOŽENÍ STRÁNKY (KONTEJNERY) --- */
.main-content {
    display: flex;
    justify-content: center;
    padding: 0 20px 40px 20px;
}

/* Základní karta */
.form-card {
    background-color: #2d3748;
    border: 1px solid #4a5568;
    border-radius: 10px;
    padding: 30px;
    width: 100%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    margin: 0 auto;
}

/* VELIKOSTI KARET - SJEDNOCENÍ */
.container-S { max-width: 500px; }  /* Login, Vytvořit MB */
.container-M { max-width: 750px; }  /* Inventura, Havi, Reporty */
.container-L { max-width: 1100px; } /* Transfery, Dodávky, Návod */

.form-title {
    color: #63b3ed;
    text-align: center;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.6em;
    font-weight: bold;
}

.form-subtitle {
    text-align: center;
    color: #a0aec0;
    margin-bottom: 30px;
    font-size: 0.95em;
    line-height: 1.5;
}

/* --- FORMULÁŘE --- */
.field-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #e2e8f0;
    font-weight: 500;
    font-size: 0.95em;
}

/* Inputy */
input[type="text"],
input[type="password"],
input[type="number"],
input[type="month"],
select,
textarea {
    width: 100%;
    padding: 12px;
    background-color: #1a202c;
    border: 1px solid #4a5568;
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 1em;
    box-sizing: border-box;
    transition: border-color 0.2s;
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
}

/* --- NAHRÁVÁNÍ SOUBORŮ (Custom File Input) --- */
.file-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background-color: #1a202c;
    border: 1px solid #4a5568;
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.2s;
    height: 45px; /* Fixní výška pro sjednocení */
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    left: 0; top: 0; width: 100%; height: 100%;
    opacity: 0; cursor: pointer;
}

.custom-file-btn {
    background-color: #4a5568;
    color: #e2e8f0;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 0.9em;
    border-right: 1px solid #4a5568;
    white-space: nowrap;
}

.custom-file-text {
    padding: 0 15px;
    color: #a0aec0;
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-input-wrapper:hover {
    border-color: #4299e1;
}
.file-input-wrapper:hover .custom-file-btn {
    background-color: #4299e1;
    color: white;
}

/* --- TLAČÍTKA --- */
.action-btn {
    background-color: #4299e1;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 1em;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s;
    text-align: center;
    display: block;
}

.action-btn:hover {
    background-color: #3182ce;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
}

.action-btn:disabled {
    background-color: #4a5568;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.7;
}

.back-link-container {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #4a5568;
}

.back-btn {
    display: inline-block;
    padding: 10px 20px;
    color: #a0aec0;
    background-color: transparent;
    border: 1px solid #4a5568;
    border-radius: 20px;
    font-size: 0.9em;
    transition: all 0.2s;
}

.back-btn:hover {
    background-color: #4a5568;
    color: white;
    text-decoration: none;
}

/* --- ALERTY --- */
.alert-box {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.95em;
}
.alert-success { background: rgba(72, 187, 120, 0.2); color: #48bb78; border: 1px solid #48bb78; }
.alert-error { background: rgba(245, 101, 101, 0.2); color: #f56565; border: 1px solid #f56565; }
.alert-info { background: rgba(66, 153, 225, 0.2); color: #63b3ed; border: 1px solid #63b3ed; }
.alert-orange { background: rgba(237, 137, 54, 0.2); color: #ed8936; border: 1px solid #ed8936; }

/* --- SPECIFICKÉ PRO DASHBOARD (DLAŽDICE) --- */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    width: 100%;
    max-width: 1100px;
}

.menu-card {
    background: #2d3748;
    border: 1px solid #4a5568;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    min-height: 180px;
    transition: all 0.3s;
}

.menu-card:hover {
    transform: translateY(-5px);
    background: #364252;
    border-color: #4299e1;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.card-icon { font-size: 2.5em; margin-bottom: 15px; }
.card-title { font-size: 1.2em; font-weight: bold; margin-bottom: 10px; color: #63b3ed; }
.card-desc { font-size: 0.9em; color: #a0aec0; line-height: 1.4; }
.menu-card:hover .card-desc { color: #cbd5e0; }

/* --- TABULKY --- */
.result-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 20px;
    border: 1px solid #4a5568;
    border-radius: 8px;
    overflow: hidden;
}

.result-table th {
    background: #232d3b;
    padding: 15px;
    text-align: left;
    color: #a0aec0;
    font-size: 0.85em;
    text-transform: uppercase;
    border-bottom: 1px solid #4a5568;
}

.result-table td {
    padding: 15px;
    border-bottom: 1px solid #4a5568;
    background: #2d3748;
}

.result-table tr:last-child td { border-bottom: none; }
.result-table tr:hover td { background: #323d4e; }

/* Status Badge */
.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 0.8em;
    display: inline-block;
}
.status-green { background: rgba(72, 187, 120, 0.2); color: #48bb78; }
.status-red { background: rgba(245, 101, 101, 0.2); color: #f56565; }
.status-orange { background: rgba(237, 137, 54, 0.2); color: #ed8936; }
.status-grey { background: rgba(160, 174, 192, 0.2); color: #a0aec0; }

/* --- LOADING OVERLAY (Načítací obrazovka) --- */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 32, 44, 0.85); /* Tmavé poloprůhledné pozadí */
    backdrop-filter: blur(5px); /* Efekt rozostření pozadí */
    z-index: 9999; /* Musí být nade vším */
    display: none; /* Defaultně skryté, JS to přepne na flex */
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-top: 5px solid #4299e1; /* Modrá barva aplikace */
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-text {
    color: #e2e8f0;
    font-size: 1.2em;
    font-weight: bold;
    letter-spacing: 1px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}