/* Administrace – navazuje na style.css (stejné barvy a písmo) */

body.admin .container { max-width: 1100px; }

[hidden] { display: none !important; }

.admin-user-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.admin-user-bar #admin-user-name { font-weight: 600; margin-right: 6px; }

/* --- TLAČÍTKA --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 20px;
    border-radius: 6px;
    border: 1px solid transparent;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s ease, opacity 0.15s ease, border-color 0.15s ease;
}

.btn:disabled { opacity: 0.55; cursor: progress; }
.btn-sm { padding: 7px 12px; font-size: 0.8rem; }
.btn-block { width: 100%; }

.btn-primary { background: var(--text-main); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #1f1e1b; }

.btn-ghost { background: transparent; color: var(--text-main); border-color: var(--text-main); }
.btn-ghost:hover:not(:disabled) { background: rgba(51, 50, 46, 0.06); }

.btn-danger-ghost { background: transparent; color: #b42318; border-color: #e7b4ae; }
.btn-danger-ghost:hover:not(:disabled) { background: #fdf0ee; }

/* --- PŘIHLÁŠENÍ --- */
.login-box {
    max-width: 420px;
    width: 100%;
    margin: 3rem auto;
    background: var(--white);
    padding: 2.5rem;
    border-radius: 10px;
    border: 1px solid var(--line-color);
}

.login-box h2 { margin: 0 0 1.5rem; text-align: center; font-size: 1.3rem; }

/* --- FORMULÁŘE --- */
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
}

.field small { font-weight: 400; color: var(--text-muted); }

.field input[type="text"],
.field input[type="password"],
.field input[type="date"],
.field textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--line-color);
    border-radius: 6px;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-main);
    background: var(--white);
}

.field textarea { resize: vertical; line-height: 1.5; }

.field input:focus,
.field textarea:focus {
    outline: 2px solid var(--text-main);
    outline-offset: -1px;
}

#f-title { font-size: 1.25rem; font-weight: 600; }

.field-row {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 20px;
    align-items: end;
}

.field-check {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    cursor: pointer;
}

.field-check input { width: 18px; height: 18px; accent-color: var(--text-main); flex-shrink: 0; }

.form-error { color: #b42318; font-size: 0.85rem; min-height: 1.2em; margin: 0 0 12px; }

/* --- ZÁLOŽKY --- */
.admin-tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--line-color);
}

.tab-btn {
    color: var(--text-muted);
    font-weight: 700;
    padding: 10px 15px 12px;
    text-transform: uppercase;
    text-decoration: none;
    font-size: 0.9rem;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
}

.tab-btn.active-tab { color: var(--text-main); border-bottom-color: var(--text-main); }

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.admin-header h1 { margin: 0; font-size: 1.6rem; }
.admin-header .back-link { margin: 0; }

/* --- SEZNAM ČLÁNKŮ --- */
.admin-post-list { list-style: none; margin: 0; padding: 0; }

.admin-list-item {
    display: grid;
    grid-template-columns: 96px 1fr auto;
    gap: 18px;
    align-items: center;
    background: var(--white);
    padding: 12px 16px 12px 12px;
    margin-bottom: 10px;
    border-radius: 8px;
    border: 1px solid var(--line-color);
}

.admin-list-item .thumb {
    width: 96px;
    height: 64px;
    border-radius: 6px;
    object-fit: cover;
    background: var(--bg-outer);
    display: block;
}

.admin-list-item .thumb.is-placeholder { object-fit: contain; padding: 6px; filter: sepia(0.3); }

.admin-list-item .info { min-width: 0; }

.admin-list-item .title {
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    display: block;
    line-height: 1.35;
    margin-bottom: 4px;
}

.admin-list-item .title:hover { text-decoration: underline; }

.admin-list-item .sub { font-size: 0.82rem; color: var(--text-muted); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #e3f1e6;
    color: #23613a;
}

.badge.draft { background: #f4ecd5; color: #7a5a12; }

.admin-list-item .actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 20px;
    background: var(--white);
    border: 1px dashed var(--line-color);
    border-radius: 8px;
}

/* --- EDITOR --- */
.editor-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.save-state { font-size: 0.82rem; color: var(--text-muted); }
.save-state.dirty { color: #7a5a12; }

.notice {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: #f4ecd5;
    border: 1px solid #e7d7a8;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.notice span { flex: 1 1 260px; }

.cover-picker { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }

.cover-preview {
    width: 240px;
    height: 150px;
    border-radius: 8px;
    border: 1px dashed var(--line-color);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.85rem;
}

.cover-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }

.cover-buttons { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

.editor-wrap {
    background: var(--white);
    border-radius: 6px;
    min-height: 600px;
}

.editor-wrap .tox-tinymce { border-color: var(--line-color); border-radius: 6px; }

.editor-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
}

.editor-footer .btn-primary { margin-left: auto; min-width: 160px; }

/* --- TRACKER --- */


.tracker-iframe {
    width: 100%;
    height: 80vh;
    min-height: 600px;
    border: 1px solid var(--line-color);
    border-radius: 8px;
    background: #fff;
    display: block;
}

/* --- DIALOG --- */
.dialog {
    border: none;
    border-radius: 10px;
    padding: 2rem;
    width: min(440px, calc(100vw - 32px));
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    font-family: 'Montserrat', sans-serif;
    color: var(--text-main);
}

.dialog::backdrop { background: rgba(30, 29, 26, 0.45); }
.dialog h2 { margin: 0 0 1.25rem; font-size: 1.25rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* --- TOAST --- */
.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    background: var(--text-main);
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    max-width: calc(100vw - 32px);
}

.toast.error { background: #b42318; }

/* Na úzkých obrazovkách */
@media (max-width: 720px) {
    .field-row { grid-template-columns: 1fr; gap: 0; }
    .admin-list-item { grid-template-columns: 72px 1fr; }
    .admin-list-item .thumb { width: 72px; height: 54px; }
    .admin-list-item .actions { grid-column: 1 / -1; justify-content: flex-start; }
    .cover-preview { width: 100%; height: 180px; }
    .cover-buttons { flex-direction: row; }
    .editor-actions { width: 100%; }
    .editor-actions .btn-primary { margin-left: auto; }
    .login-box { padding: 1.75rem; margin: 1rem auto; }
}
