:root {
    --bg: #fafafa;
    --card: #ffffff;
    --muted: #6b6b6b;
    --accent: #b71c1c;
    --radius: 12px;
    --maxw: 1180px;
    --shadow: 0 10px 30px rgba(15, 15, 15, 0.06);
    --text: #0b1220;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
.container { max-width: var(--maxw); margin: 28px auto; padding: 18px; }

/* HEADER */
.header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { width: 68px; height: 54px; border-radius: 10px; background: var(--accent); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 18px; overflow: hidden; background-size: cover; background-position: center; }
.h1 { font-weight: 700; font-size: 20px; margin: 0; }
.subtitle { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* CARDS & LAYOUT */
.card { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); overflow: hidden; }
.hero { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: center; }
@media (max-width: 980px) { .hero { grid-template-columns: 1fr; } .poster-col { order: -1; } }
.lead { color: var(--muted); margin: 0 0 12px; font-size: 15px; }
h1, h2, h3, .h1, .subtitle, .lead, .meta, .tab, .price-label, .price-value, #siteTitle, #siteSubtitle, #heroTitle, #heroLead, #asidePlace, #asideDate, #asideContact { overflow-wrap: anywhere; word-break: break-word; }

/* POSTER */
.poster { border-radius: 10px; overflow: hidden; cursor: pointer; border: 1px solid #eee; margin: 0; }
.poster img { width: 100%; height: auto; display: block; object-fit: contain; }

/* LAYOUT COLUMNS */
.layout { display: grid; grid-template-columns: 1fr 360px; gap: 22px; margin-top: 18px; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }

/* TABS */
.tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.tab { padding: 10px 14px; border-radius: 12px; background: #fff; border: 1px solid #eee; color: var(--text); font-weight: 700; cursor: pointer; white-space: normal; max-width: 240px; position: relative; }
.tab.active { background: #fff; border-color: var(--accent); color: var(--accent); }

/* PROGRAM & TIMELINE */
.program { margin-top: 6px; }
.day { display: none; }
.day.active { display: block; }
.timeline { display: flex; flex-direction: column; gap: 14px; }
.session { display: grid; grid-template-columns: minmax(88px, 120px) 1fr; gap: 18px; padding: 18px; border-radius: 12px; border: 1px solid #f3f3f3; align-items: start; background: #fff; transition: opacity 0.2s; }
.time { font-weight: 800; color: var(--accent); word-break: break-word; }
.session > .time { min-width: 0; }
.session > div { min-width: 0; }
.meta { color: var(--muted); font-size: 15px; margin-top: 8px; }
.speaker { display: flex; gap: 12px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.speaker img { width: 56px; height: 56px; border-radius: 999px; object-fit: cover; border: 1px solid #eee; }

/* ASIDE & PRICING */
.aside-note { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.pricing { display: flex; flex-direction: column; gap: 10px; }
.price-bubble { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; background: #fff; border: 1px solid #f3f3f3; }
.price-label { font-weight: 700; color: #111; min-width: 0; }
.price-value { font-weight: 800; color: var(--accent); min-width: 0; text-align: right; }
.small { font-size: 13px; color: var(--muted); }

/* MODALS (Generic structure) */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); display: none; align-items: center; justify-content: center; z-index: 2000; padding: 20px; overflow-y: auto; }
.modal { background: #fff; padding: 18px; border-radius: 10px; max-width: 720px; width: 94%; box-shadow: 0 8px 26px rgba(0, 0, 0, 0.12); max-height: 90vh; display: flex; flex-direction: column; }
.modal h3 { margin: 0 0 8px; }
.modal .content { margin-top: 8px; white-space: pre-wrap; color: #222; overflow-y: auto; flex: 1; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; flex-shrink: 0; }

/* BUTTONS */
.btn { cursor: pointer; border: 0; background: transparent; padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: 14px; transition: background 0.1s; border: 1px solid transparent; }
.btn:hover { background: rgba(0,0,0,0.04); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.small { padding: 4px 8px; font-size: 12px; }

/* ADMIN FLOATING PANEL */
#adminFloating { position: fixed; right: 16px; bottom: 16px; z-index: 1400; background: #fff; padding: 10px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border: 1px solid #eee; }

/* FOOTER */
.footer { margin-top: 18px; text-align: center; color: var(--muted); font-size: 14px; }
.footer .admin-link { font-size: 12px; color: var(--muted); margin-left: 8px; text-decoration: underline; cursor: pointer; }

/* LOADING */
#loadingOverlay { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.8); z-index: 99999; backdrop-filter: blur(2px); }
#loadingOverlay .box { background: #fff; padding: 16px; border-radius: 10px; min-width: 200px; text-align: center; box-shadow: var(--shadow); border: 1px solid #eee; }
#loadingOverlay .spinner { width: 32px; height: 32px; border-radius: 50%; border: 3px solid #eee; border-top-color: var(--accent); margin: 8px auto; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* RTE & EDITING */
#rteBar { position: fixed; left: 16px; bottom: 16px; z-index: 1605; display: none; gap: 8px; align-items: center; flex-wrap: wrap; background: #fff; border: 1px solid #ececec; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .08); padding: 8px 10px; }
#rteBar .btn { border: 1px solid #eee; background: #fff; padding: 6px 10px; }
.editing-outline [contenteditable="true"] { outline: 2px dashed rgba(183, 28, 28, .25); outline-offset: 4px; border-radius: 4px; }
.rte-img { max-width: 100%; height: auto; border-radius: 6px; }

/* IMAGE EDITOR */
#imgEditorBackdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); display: none; align-items: center; justify-content: center; z-index: 50000; }
#imgEditor { background: #fff; width: min(96vw, 600px); max-height: 90vh; padding: 16px; border-radius: 12px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
#imgEditCanvas { width: 100%; max-height: 50vh; border: 1px dashed #ddd; border-radius: 8px; background: #fafafa; cursor: grab; display: block; margin: 0 auto; object-fit: contain; }
#imgEditor .toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.range { accent-color: var(--accent); cursor: pointer; }

/* --- ADMIN V2.0 --- */
.admin-icon { 
    cursor: pointer; font-size: 16px; margin: 0 4px; vertical-align: middle; opacity: 0.6; transition: opacity .2s; 
}
.admin-icon:hover { opacity: 1; transform: scale(1.1); }
.admin-icon-del {
    cursor: pointer; font-size: 18px; font-weight: 700; color: var(--accent); margin-left: 8px; vertical-align: middle; opacity: 0.6; transition: opacity .2s;
}
.admin-icon-del:hover { opacity: 1; color: #d32f2f; }

/* Posun textu v tabech, aby bylo místo pro ikony */
body.is-admin .tab { padding-right: 50px; }
body.is-admin .tab .admin-icon, body.is-admin .tab .admin-icon-del { position: absolute; top: 50%; transform: translateY(-50%); z-index: 10; }
body.is-admin .tab .admin-icon { right: 28px; }
body.is-admin .tab .admin-icon-del { right: 8px; }

/* Vstupy v settings modalu */
.settings-field { margin-bottom: 12px; }
.settings-field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.settings-field input { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 8px; font-size: 15px; }

@media (max-width: 640px) {
    .h1 { font-size: 18px; }
    .logo { width: 56px; height: 44px; font-size: 16px; }
    #adminFloating { bottom: 0; right: 0; left: 0; border-radius: 0; border-top: 1px solid #ddd; justify-content: center; }
}