/* Společný vzhled galerie i průvodce importem. */

:root {
    --modra: #1976D2;
    --modra-tmava: #1565C0;
    --zelena: #388E3C;
    --cervena: #E53935;
    --oranzova: #E65100;
    --fialova: #6A1B9A;
    --tyrkys: #00838F;
    --seda-tmava: #455A64;
    --ram: #cdd5e3;
    --ram-svetly: #e4e8f0;
    --pozadi: #f0f2f5;
    --text: #222;
    --text-slaby: #777;
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--pozadi);
    color: var(--text);
    padding: 20px;
    margin: 0;
}

h1 { text-align: center; color: var(--text); margin: 0 0 18px; font-size: 22px; font-weight: 700; }
a { color: var(--modra); }
code { background: #e3f2fd; color: var(--modra-tmava); padding: 2px 6px; border-radius: 3px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }

/* ---------- tlačítka ---------- */
button, .btn {
    border: none; padding: 11px 20px; border-radius: 9px; font-weight: 700; font-size: 14px;
    cursor: pointer; font-family: inherit; transition: background .15s, opacity .15s, transform .1s;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    text-decoration: none;
}
button:hover, .btn:hover { opacity: .9; }
button:active, .btn:active { transform: scale(.97); }
button:focus-visible, .btn:focus-visible, input:focus-visible, select:focus-visible, .dropzone:focus-visible {
    outline: 3px solid rgba(25, 118, 210, .45); outline-offset: 2px;
}
button:disabled { background: #e0e0e0 !important; color: #aaa !important; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--modra); color: #fff; }
.btn-green   { background: var(--zelena); color: #fff; }
.btn-grey    { background: #eceff3; color: #444; }
.btn-teal    { background: var(--tyrkys); color: #fff; }
.btn-dark    { background: var(--seda-tmava); color: #fff; }
.btn-add     { background: var(--tyrkys); color: #fff; padding: 7px 14px; font-size: 13px; }
.btn-del-seg { background: var(--cervena); color: #fff; padding: 6px 10px; font-size: 12px; }

/* ---------- formulářové prvky ---------- */
input[type=text], input[type=password], input[type=number], select {
    padding: 9px 11px; border: 1px solid var(--ram); border-radius: 8px;
    font-size: 14px; font-family: inherit; background: #fff; color: var(--text);
}
.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: #555; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #444; cursor: pointer; user-select: none; }
.check input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--modra); cursor: pointer; }
.row { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-end; }

/* ---------- horní lišta ---------- */
.topbar {
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
    max-width: 1180px; margin: 0 auto 14px;
}
.topbar .search-wrap { flex: 1 1 260px; position: relative; }
.topbar .search-wrap input {
    width: 100%; padding: 11px 42px 11px 16px; font-size: 15px;
    border: 2px solid #dde3ef; border-radius: 10px; outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.topbar .search-wrap input:focus { border-color: var(--modra); box-shadow: 0 0 0 3px rgba(25,118,210,.15); }
.topbar .search-wrap input::placeholder { color: #aab; }
.search-clear {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; color: #aaa;
    font-size: 18px; padding: 4px 6px; display: none; line-height: 1;
}
.search-clear:hover { color: var(--cervena); opacity: 1; }
.topbar .btn { padding: 11px 16px; font-size: 13px; text-transform: uppercase; letter-spacing: .4px; white-space: nowrap; }

#filter-info { text-align: center; font-size: 13px; color: #888; margin-bottom: 14px; min-height: 18px; }

.warn-banner {
    max-width: 1180px; margin: 0 auto 16px; background: #fff8e1; border-left: 4px solid #f9a825;
    padding: 11px 16px; border-radius: 6px; font-size: 14px; color: #7a5a00;
}

/* ---------- galerie ---------- */
.gallery {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 20px; padding-bottom: 80px;
}
.card {
    background: #fff; padding: 12px; border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    display: flex; flex-direction: column;
    transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.12); }

.filename { font-weight: 700; font-size: 15px; color: #444; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.file-id { color: var(--modra); font-size: 16px; }
.file-name { font-weight: 400; font-size: 11px; color: #999; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.img-wrap { height: 180px; overflow: hidden; border-radius: 7px; border: 1px solid #eee; margin-bottom: 10px; cursor: zoom-in; background: #fafafa; }
.img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; display: block; }
.img-wrap:hover img { transform: scale(1.05); }

.info-preview {
    font-size: 12px; color: #555; background: #f0f4ff; padding: 7px 10px;
    border-radius: 5px; margin-bottom: 10px; min-height: 38px;
    line-height: 1.4; border-left: 3px solid var(--modra);
}
.actions { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.btn-row { display: flex; gap: 5px; }
.actions button {
    padding: 9px 6px; border-radius: 7px; font-size: 11px; flex: 1;
    text-transform: uppercase; letter-spacing: .4px;
}
.btn-nazev  { background: var(--modra); color: #fff; }
.btn-cena   { background: var(--zelena); color: #fff; }
.btn-info   { background: var(--oranzova); color: #fff; }
.btn-aukce  { background: var(--fialova); color: #fff; }
.btn-custom { background: var(--tyrkys); color: #fff; }
.btn-del    { background: var(--cervena); color: #fff; padding: 11px !important; margin-top: 4px; font-size: 12px !important; }
.no-data { color: var(--cervena); font-size: 13px; text-align: center; padding: 6px 0; margin: 0; }

/* ---------- lightbox a toast ---------- */
#lightbox {
    position: fixed; inset: 0; background: rgba(0,0,0,.93); display: none;
    justify-content: center; align-items: center; z-index: 2000; cursor: zoom-out;
}
#lightbox img { max-width: 95vw; max-height: 95vh; box-shadow: 0 0 40px rgba(0,0,0,.8); border-radius: 4px; }

.toast {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
    background: #1a1a2e; color: #fff; padding: 11px 22px; border-radius: 22px;
    font-size: 14px; display: none; z-index: 3000; align-items: center; gap: 14px;
    box-shadow: 0 4px 14px rgba(0,0,0,.3);
}
.toast.show { display: flex; }
.toast button {
    background: #3d3d5c; color: #fff; padding: 5px 12px; font-size: 12px;
    border-radius: 14px; text-transform: uppercase; letter-spacing: .4px;
}

/* ---------- modální okna ---------- */
.modal {
    position: fixed; inset: 0; background: rgba(0,0,0,.55);
    display: none; justify-content: center; align-items: flex-start;
    z-index: 4000; padding: 30px 16px; overflow-y: auto;
}
.modal.show { display: flex; }
.modal-panel { background: #fff; border-radius: 14px; width: 100%; max-width: 900px; box-shadow: 0 12px 40px rgba(0,0,0,.3); padding: 24px; }
.modal-panel h2 { margin: 0 0 4px; font-size: 20px; }
.modal-panel .sub { color: var(--text-slaby); font-size: 13px; margin: 0 0 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.modal-actions button { font-size: 14px; padding: 11px 22px; }

/* ---------- tabulky ---------- */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 8px 10px; border: 1px solid var(--ram-svetly); text-align: left; vertical-align: middle; }
.data-table th { background: #f5f7fb; font-weight: 700; color: #444; }
.data-table td { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.data-table select, .data-table input[type=text] { width: 100%; padding: 6px 8px; font-size: 13px; }
.data-table .col-name { font-weight: 700; color: var(--modra); white-space: nowrap; }
.data-table .sample { color: #666; font-size: 12px; max-width: 280px; word-break: break-word; }
.scroll-x { overflow-x: auto; }
input.narrow { width: 80px; }

/* ---------- dropzone ---------- */
.dropzone {
    border: 2px dashed var(--ram); border-radius: 10px; padding: 26px; text-align: center;
    color: var(--text-slaby); cursor: pointer; background: #fff;
    transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--modra); background: #f0f6ff; }
.dropzone strong { color: var(--text); }

.upload-list { margin-top: 14px; font-size: 13px; display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow-y: auto; }
.upload-item { display: flex; justify-content: space-between; gap: 12px; padding: 5px 9px; border-radius: 6px; background: #f7f9fc; }
.upload-item.ok   { background: #edf7ed; color: #2e6b31; }
.upload-item.fail { background: #fdecea; color: #a52a25; }
.upload-item .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item .state { white-space: nowrap; font-weight: 600; }

.progress { height: 6px; background: #e6ebf2; border-radius: 3px; overflow: hidden; margin-top: 12px; display: none; }
.progress.show { display: block; }
.progress > div { height: 100%; width: 0; background: var(--modra); transition: width .2s; }

/* ---------- seznam lidí ---------- */
.user-list { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
.user-item {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 9px 12px; border-radius: 8px; background: #f7f9fc; border: 1px solid var(--ram-svetly);
}
.user-item .user-name { font-size: 14px; color: var(--text); word-break: break-word; }

/* ---------- zprávy ---------- */
.msg { font-size: 13px; min-height: 18px; margin-top: 8px; }
.msg.err { color: var(--cervena); }
.msg.ok  { color: var(--zelena); }

/* ---------- karty průvodce ---------- */
.wrap { max-width: 1180px; margin: 0 auto; }
.lead { text-align: center; color: var(--text-slaby); font-size: 14px; margin: 0 0 22px; }
.card-box { background: #fff; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.08); padding: 22px; margin-bottom: 20px; }
.card-box h2 { margin: 0 0 14px; font-size: 17px; color: var(--modra); }
.card-box.disabled { opacity: .5; pointer-events: none; }
.hint { font-size: 13px; color: var(--text-slaby); margin: 0 0 10px; }
.result-title { font-weight: 600; }
.len-ok  { color: var(--zelena); font-weight: 700; }
.len-cut { color: var(--oranzova); font-weight: 700; }

/* ---------- nápověda ---------- */
.help-box {
    margin-top: 50px; padding: 24px; background: #fff; border-left: 5px solid var(--modra);
    border-radius: 8px; font-size: 14px; line-height: 1.7; color: #444;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.help-box h2 { margin-top: 0; font-size: 18px; color: var(--modra); }
.help-box ol { margin: 6px 0; padding-left: 22px; }

/* ---------- přihlášení ---------- */
.login-wrap { min-height: 70vh; display: flex; align-items: center; justify-content: center; }
.login-card { background: #fff; border-radius: 14px; box-shadow: 0 4px 20px rgba(0,0,0,.1); padding: 32px; width: 100%; max-width: 380px; }
.login-card h1 { margin-bottom: 6px; }
.login-card p.sub { text-align: center; color: var(--text-slaby); font-size: 13px; margin: 0 0 22px; }
.login-card label { display: block; font-size: 13px; color: #555; margin-bottom: 6px; }
.login-card input { width: 100%; font-size: 16px; padding: 12px 14px; }
.login-card button { width: 100%; margin-top: 16px; padding: 13px; font-size: 15px; }
.login-err { background: #fdecea; color: #a52a25; padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.login-hint { font-size: 12px; color: var(--text-slaby); margin: 8px 0 0; }

@media (max-width: 700px) {
    body { padding: 12px; }
    .gallery { grid-template-columns: 1fr; }
    .topbar { flex-direction: column; align-items: stretch; }
    .topbar .btn { justify-content: center; }
}
