:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --text: #172033;
    --muted: #667085;
    --line: #d9e1ec;
    --primary: #1d5fd1;
    --primary-dark: #164ba6;
    --danger: #b42318;
    --success: #027a48;
    --warning: #b54708;
    --radius: 18px;
    --shadow: 0 18px 45px rgba(30, 64, 120, .10);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background: radial-gradient(circle at top left, #eaf1ff, transparent 35%), var(--bg);
    color: var(--text);
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
    line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.topbar { background: rgba(255,255,255,.86); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 10; }
.topbar__inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { color: var(--text); font-weight: 800; letter-spacing: -.02em; font-size: 1.1rem; }
.nav { display: flex; gap: 18px; }
.nav a { color: var(--muted); font-weight: 600; }
.main { padding: 34px 0 56px; }
.footer { color: var(--muted); padding: 26px 0; border-top: 1px solid var(--line); font-size: .92rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 24px; }
h1 { margin: 0 0 8px; font-size: clamp(1.8rem, 3vw, 2.7rem); line-height: 1.08; letter-spacing: -.04em; }
h2 { margin: 0 0 18px; font-size: 1.25rem; }
.lead { color: var(--muted); margin: 0; font-size: 1.05rem; }
.eyebrow { color: var(--primary); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; margin: 0 0 8px; }
.card { background: var(--surface); border: 1px solid rgba(217,225,236,.9); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.card--narrow { max-width: 760px; margin: 0 auto; }
.grid { display: grid; gap: 24px; }
.grid--2 { grid-template-columns: minmax(280px, .85fr) minmax(360px, 1.15fr); }
.badge, .capacity { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 10px 16px; box-shadow: var(--shadow); white-space: nowrap; }
.capacity span { display: block; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.capacity strong { font-size: 1.1rem; }
.capacity--full { border-color: #fedf89; background: #fffbeb; }
.details { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; margin: 0 0 18px; }
.details dt { color: var(--muted); font-weight: 700; }
.details dd { margin: 0; }
.description { border-top: 1px solid var(--line); padding-top: 16px; color: #344054; }
.form { display: grid; gap: 16px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field label { display: block; font-weight: 700; margin-bottom: 7px; }
.field label span { color: var(--danger); }
input, textarea, select { width: 100%; border: 1px solid #cbd5e1; border-radius: 12px; padding: 11px 12px; font: inherit; background: #fff; color: var(--text); }
input:focus, textarea:focus, select:focus { outline: 3px solid rgba(29, 95, 209, .16); border-color: var(--primary); }
.button { appearance: none; border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 11px 18px; border-radius: 12px; background: var(--primary); color: #fff; font-weight: 800; cursor: pointer; box-shadow: 0 10px 20px rgba(29,95,209,.22); }
.button:hover { background: var(--primary-dark); text-decoration: none; }
.button--secondary { background: #eef4ff; color: var(--primary); box-shadow: none; }
.button--secondary:hover { background: #dbe8ff; }
.button--danger { background: var(--danger); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.actions--right { justify-content: flex-end; margin-top: 0; margin-bottom: 16px; }
.notice { border-radius: 16px; padding: 16px; margin-bottom: 18px; }
.notice--success { background: #ecfdf3; border: 1px solid #abefc6; color: #054f31; }
.notice--warning { background: #fffaeb; border: 1px solid #fedf89; color: #7a2e0e; }
.notice--error { background: #fef3f2; border: 1px solid #fecdca; color: #7a271a; }
.notice--info { background: #eef4ff; border: 1px solid #b2ccff; color: #1849a9; }
.pill { display: inline-flex; margin-top: 6px; padding: 3px 9px; border-radius: 999px; background: #eef4ff; color: #1849a9; font-size: .78rem; font-weight: 800; }
.table-wrap { overflow-x: auto; }
.table { border-collapse: collapse; width: 100%; min-width: 820px; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { background: var(--surface-2); color: #475467; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; }
.status { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 10px; font-size: .82rem; font-weight: 800; background: #eef4ff; color: #175cd3; }
.status--cancelled, .status--deleted { background: #fef3f2; color: #b42318; }
.status--closed { background: #f2f4f7; color: #475467; }
.status--waiting { background: #fffaeb; color: #b54708; }
.status--active, .status--open { background: #ecfdf3; color: #027a48; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.empty { text-align: center; color: var(--muted); padding: 26px !important; }
pre, code { background: #f2f4f7; border-radius: 8px; padding: 2px 6px; }
pre { white-space: pre-wrap; padding: 12px; overflow-x: auto; }
@media (max-width: 820px) {
    .page-head, .topbar__inner { flex-direction: column; align-items: flex-start; }
    .grid--2, .field-grid { grid-template-columns: 1fr; }
    .details { grid-template-columns: 1fr; gap: 4px; }
    .capacity { border-radius: 16px; }
}
.page-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.form-section { border-top: 1px solid var(--line); padding-top: 20px; }
.form-section:first-child { border-top: 0; padding-top: 0; }
.field-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field-error { color: var(--danger); font-size: .86rem; margin-top: 6px; font-weight: 700; }
.hint { color: var(--muted); margin: 6px 0 0; font-size: .92rem; }
.check-list { display: grid; gap: 12px; }
.check-row { display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); cursor: pointer; }
.check-row input { width: 18px; height: 18px; margin-top: 3px; }
.check-row small { display: block; color: var(--muted); margin-top: 3px; }
.link-box { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); margin-bottom: 14px; }
.link-box label { font-weight: 800; color: var(--text); }
.link-box input { font-family: Consolas, "Courier New", monospace; font-size: .92rem; }
@media (max-width: 980px) {
    .field-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .field-grid--4 { grid-template-columns: 1fr; }
}
.table--events { min-width: 1180px; }
.mini-button { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 6px 11px; border-radius: 10px; background: var(--primary); color: #fff; font-weight: 800; font-size: .86rem; box-shadow: 0 8px 18px rgba(29,95,209,.18); }
.mini-button:hover { background: var(--primary-dark); color: #fff; text-decoration: none; }
.mini-button--secondary { background: #eef4ff; color: var(--primary); box-shadow: none; }
.mini-button--secondary:hover { background: #dbe8ff; color: var(--primary); }
.url-small { margin-top: 6px; max-width: 230px; color: var(--muted); font-family: Consolas, "Courier New", monospace; font-size: .78rem; overflow-wrap: anywhere; }

/* v0.1.7 – přehled akcí: kompaktnější odkazy a čitelný stav */
.table--events { min-width: 1120px; }
.table--events th:nth-child(1), .table--events td:nth-child(1) { min-width: 135px; }
.table--events th:nth-child(4), .table--events td:nth-child(4) { min-width: 105px; white-space: nowrap; }
.table--events th:nth-child(5), .table--events td:nth-child(5) { min-width: 105px; }
.table--events th:nth-child(6), .table--events td:nth-child(6) { min-width: 190px; }
.table--events th:nth-child(7), .table--events td:nth-child(7) { min-width: 125px; white-space: nowrap; }
.status { white-space: nowrap; }
.table--events .url-small { max-width: 190px; font-family: "Segoe UI", Roboto, Arial, sans-serif; font-size: .82rem; }

/* v0.2.0 – zrušení akce a prezenční listina */
.link-box--danger { border-color: #fecdca; background: #fff5f5; }
.button--danger:hover { background: #97180c; }
.table--events { min-width: 1240px; }
.table--events th:nth-child(7), .table--events td:nth-child(7) { min-width: 110px; white-space: nowrap; }
.table--events th:nth-child(8), .table--events td:nth-child(8) { min-width: 125px; white-space: nowrap; }

/* v0.2.6 – filtry v přehledu a obnova z archivu */
.filter-card { margin-bottom: 18px; padding: 18px; }
.filter-form { display: grid; grid-template-columns: minmax(260px, 1.6fr) minmax(130px, .7fr) minmax(145px, .75fr) minmax(145px, .75fr) auto; gap: 14px; align-items: end; }
.filter-form label { display: block; font-weight: 800; margin-bottom: 7px; }
.filter-field--wide { min-width: 260px; }
.filter-actions { display: flex; gap: 10px; align-items: center; }
@media (max-width: 1100px) {
    .filter-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filter-actions { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
    .filter-form { grid-template-columns: 1fr; }
}

.actions--wrap { flex-wrap: wrap; }

/* v0.3.2 – přehled: oddělené ukončené akce, české stavy a detail akce při najetí */
.status--draft { background: #f2f4f7; color: #475467; }
.status--full { background: #fffaeb; color: #b54708; }
.table-wrap--hovercards { overflow: visible; }
.event-row { position: relative; }
.event-row:hover td { background: #fbfdff; }
.event-title-cell { position: relative; min-width: 290px; }
.event-popover {
    display: none;
    position: absolute;
    left: min(100%, 360px);
    top: 8px;
    width: min(520px, 70vw);
    z-index: 50;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(16, 24, 40, .20);
    color: var(--text);
}
.event-row:hover .event-popover,
.event-row:focus-within .event-popover {
    display: block;
}
.event-popover::before {
    content: "";
    position: absolute;
    left: -9px;
    top: 22px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-left: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    transform: rotate(45deg);
}
.event-popover__head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--line);
}
.event-popover__grid {
    display: grid;
    grid-template-columns: 145px 1fr;
    gap: 7px 12px;
    margin: 0;
    font-size: .92rem;
}
.event-popover__grid dt { color: var(--muted); font-weight: 800; }
.event-popover__grid dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.event-popover__desc {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    color: #344054;
    font-size: .92rem;
}
@media (max-width: 900px) {
    .table-wrap--hovercards { overflow-x: auto; }
    .event-popover { display: none !important; }
}

/* v0.3.5 – přehled akcí: šířky sloupců, organizátor a kompaktnější texty */
.table--events {
    min-width: 1320px;
    table-layout: fixed;
}
.table--events col.col-term { width: 130px; }
.table--events col.col-event { width: 290px; }
.table--events col.col-location { width: 230px; }
.table--events col.col-organizer { width: 190px; }
.table--events col.col-capacity { width: 110px; }
.table--events col.col-registration { width: 120px; }
.table--events col.col-instructions { width: 115px; }
.table--events col.col-restore { width: 115px; }
.table--events col.col-status { width: 125px; }

.table--events td,
.table--events th {
    overflow-wrap: normal;
}

.table--events .event-title-cell {
    min-width: 0;
}
.table--events .event-title-cell strong {
    font-size: .96rem;
    line-height: 1.35;
}
.table--events .event-type {
    display: inline-block;
    margin-top: 3px;
    font-size: .86rem;
    line-height: 1.35;
}
.table--events .event-location-cell {
    font-size: .9rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}
.table--events .event-organizer-cell {
    white-space: normal !important;
    overflow-wrap: anywhere;
}
.table--events .organizer-name {
    line-height: 1.35;
}
.table--events .organizer-email {
    margin-top: 6px;
    color: var(--muted);
    font-size: .78rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}
.table--events .event-capacity-cell,
.table--events .event-action-cell,
.table--events .event-status-cell {
    white-space: nowrap;
}
.table--events .event-action-cell,
.table--events .event-status-cell {
    text-align: left;
}
.table--events .mini-button {
    white-space: nowrap;
}
.table--events .event-status-cell .status {
    white-space: nowrap;
}

/* v0.3.6 – přehled akcí: zúžení tabulky, aby nebyl odříznutý sloupec Pokyny */
.table--events {
    min-width: 1080px;
    table-layout: fixed;
}
.table--events th,
.table--events td {
    padding-left: 10px;
    padding-right: 10px;
}
.table--events col.col-term { width: 105px; }
.table--events col.col-event { width: 275px; }
.table--events col.col-location { width: 200px; }
.table--events col.col-organizer { width: 150px; }
.table--events col.col-capacity { width: 86px; }
.table--events col.col-registration { width: 100px; }
.table--events col.col-instructions { width: 96px; }
.table--events col.col-restore { width: 86px; }
.table--events col.col-status { width: 88px; }
.table--events .mini-button {
    min-height: 31px;
    padding: 6px 9px;
    font-size: .84rem;
}
.table--events .event-capacity-cell {
    font-size: .92rem;
}
.table--events .event-action-cell,
.table--events .event-status-cell {
    overflow: visible;
}
.table--events .status {
    padding-left: 8px;
    padding-right: 8px;
    font-size: .78rem;
}


/* v0.3.9 – přehled akcí: bez samostatného sloupce Stav, aby nebyl oříznutý sloupec Pokyny */
.table--events {
    min-width: 980px;
    table-layout: fixed;
}
.table--events col.col-term { width: 105px; }
.table--events col.col-event { width: 300px; }
.table--events col.col-location { width: 200px; }
.table--events col.col-organizer { width: 155px; }
.table--events col.col-capacity { width: 82px; }
.table--events col.col-registration { width: 104px; }
.table--events col.col-instructions { width: 104px; }
.table--events col.col-restore { width: 96px; }
.table--events th,
.table--events td {
    padding-left: 9px;
    padding-right: 9px;
}
.table--events .event-inline-status {
    margin-top: 7px;
}
.table--events .event-inline-status .status {
    font-size: .72rem;
    padding: 3px 8px;
}
.table--events .event-action-cell--instructions,
.table--events th:nth-last-child(1) {
    overflow: visible;
}
.table--events .mini-button {
    max-width: 100%;
}

/* v0.3.9 – seznam účastníků: náhradníci a převod mezi účastníky */
.table--registrations {
    min-width: 1120px;
}
.table--registrations td,
.table--registrations th {
    vertical-align: top;
}
.capacity small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
}

/* v0.4.3 - GDPR notice and longer checkbox help text */
.privacy-notice { margin-top: 14px; line-height: 1.5; }
.privacy-notice p { margin: 0 0 10px; }
.privacy-notice p:last-child { margin-bottom: 0; }
.check-row small + small { margin-top: 7px; }

/* v0.4.3 - Typ úředníka v registračním formuláři jako pevný výběr. */

/* v0.4.4 – krátký návod k aplikaci */
.guide-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}
.guide-card h2 {
    margin-bottom: 10px;
}
.guide-card p {
    margin: 0 0 12px;
}
.guide-list {
    margin: 0;
    padding-left: 20px;
}
.guide-list li {
    margin: 6px 0;
}
.guide-card--wide {
    grid-column: 1 / -1;
}
.guide-table-wrap {
    overflow-x: auto;
}
.guide-table {
    min-width: 760px;
}
.guide-table td:first-child {
    white-space: nowrap;
}
@media (max-width: 900px) {
    .guide-grid {
        grid-template-columns: 1fr;
    }
}


/* v0.4.6 – hlavička, veřejný registrační režim a patička */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.topbar .brand {
    line-height: 1.25;
}
.footer a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* v0.4.6 – dynamické Reply-To pro e-mailovou komunikaci */

/* v0.4.8 – vytvoření kopie akce */
.event-action-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
}
.mini-button--light {
    background: #eef4ff;
    color: #2554a7;
    box-shadow: none;
}
.mini-button--light:hover,
.mini-button--light:focus {
    background: #ddeaff;
}
