:root {
    --brand-blue: #004f9f;
    --brand-blue-dark: #003b78;
    --brand-blue-soft: #eaf3fb;
    --gls-blue: #1026b3;
    --gls-yellow: #ffdf00;
    --text: #172033;
    --muted: #667085;
    --line: #dce3eb;
    --surface: #ffffff;
    --background: #f4f7fa;
    --success: #137a4e;
    --success-bg: #e9f8f0;
    --warning: #9a6700;
    --warning-bg: #fff7d6;
    --danger: #b42318;
    --danger-bg: #fef0ef;
    --radius: 16px;
    --shadow: 0 12px 30px rgba(31, 45, 61, .08);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
    margin: 0;
    min-height: 100vh;
    background: var(--background);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}
body.modal-open { overflow: hidden; }
a { color: var(--brand-blue); }
button, input { font: inherit; }
.container { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }

.site-header {
    background: var(--surface);
    border-top: 6px solid var(--brand-blue);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    min-height: 92px;
    display: flex;
    align-items: center;
    gap: 24px;
}
.brand { display: inline-flex; align-items: center; flex: 0 0 auto; }
.brand img { display: block; width: 270px; max-width: 38vw; height: auto; }
.header-title { display: flex; flex-direction: column; gap: 2px; border-left: 1px solid var(--line); padding-left: 24px; }
.header-title strong { font-size: 18px; }
.header-title span { color: var(--muted); font-size: 13px; }
.admin-nav { margin-left: auto; display: flex; gap: 18px; align-items: center; }
.admin-nav a { text-decoration: none; font-weight: 700; font-size: 14px; }

.main-content { padding: 44px 0 56px; min-height: calc(100vh - 170px); }
.site-footer { border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 13px; }
.footer-inner { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.narrow-card { max-width: 680px; margin: 0 auto; padding: clamp(24px, 5vw, 44px); }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 12px; font-size: clamp(28px, 4vw, 42px); line-height: 1.12; letter-spacing: -.025em; }
h2 { margin-bottom: 8px; font-size: 20px; }
.lead { color: var(--muted); font-size: 17px; margin-bottom: 28px; }
.step-label { color: var(--brand-blue); font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field-wide { grid-column: 1 / -1; }
.field span { font-size: 13px; font-weight: 750; color: #344054; }
.field small { color: var(--muted); }
.field input, .link-cell input {
    width: 100%;
    border: 1px solid #cfd8e3;
    border-radius: 10px;
    padding: 12px 13px;
    background: #fff;
    color: var(--text);
    outline: none;
}
.field input:focus, .link-cell input:focus { border-color: var(--brand-blue); box-shadow: 0 0 0 3px rgba(0, 79, 159, .12); }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 46px;
    border: 0;
    border-radius: 10px;
    padding: 11px 18px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: transform .15s ease, background .15s ease, opacity .15s ease;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .48; cursor: not-allowed; transform: none; }
.button-primary { background: var(--brand-blue); color: #fff; }
.button-primary:hover { background: var(--brand-blue-dark); }
.button-secondary { background: var(--brand-blue-soft); color: var(--brand-blue); }
.button-gls { background: var(--gls-blue); color: #fff; min-height: 56px; font-size: 17px; }
.button-full { width: 100%; }
.button-small { min-height: 34px; padding: 7px 10px; font-size: 12px; }
.gls-dot { width: 13px; height: 13px; border-radius: 50%; background: var(--gls-yellow); box-shadow: 0 0 0 4px rgba(255, 223, 0, .16); }

.alert { border-radius: 10px; padding: 13px 15px; margin-bottom: 20px; font-size: 14px; }
.alert ul { margin-bottom: 0; }
.alert-error { color: var(--danger); background: var(--danger-bg); border: 1px solid #f7c8c4; }
.alert-success { color: var(--success); background: var(--success-bg); border: 1px solid #b9e8d0; }

.customer-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 26px; align-items: start; }
.customer-card { padding: clamp(24px, 5vw, 44px); }
.customer-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 18px; background: #f7f9fc; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 24px; }
.customer-summary div { display: flex; flex-direction: column; }
.customer-summary span { color: var(--muted); font-size: 12px; }
.customer-summary strong { font-size: 14px; }
.selection-form { margin-top: 18px; }
.selected-place { min-height: 160px; border: 2px solid var(--brand-blue); border-radius: 14px; padding: 22px; margin: 18px 0; background: var(--brand-blue-soft); }
.selected-place.is-empty { border-style: dashed; border-color: #b7c4d2; background: #fafbfd; }
.empty-selection { display: none; min-height: 112px; align-items: center; justify-content: center; text-align: center; flex-direction: column; color: var(--muted); }
.is-empty .empty-selection { display: flex; }
.is-empty .place-selection { display: none; }
.place-selection { display: flex; flex-direction: column; gap: 4px; }
.place-selection strong, .selected-place-confirmed strong { font-size: 20px; }
.place-type { display: inline-flex; align-self: flex-start; color: var(--brand-blue); background: #fff; border: 1px solid #bdd4e9; padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; text-transform: uppercase; margin-bottom: 6px; }
.selected-place small { color: var(--muted); margin-top: 7px; }
.selected-place-confirmed { display: flex; flex-direction: column; margin-top: 24px; }
.capacity-note { margin-top: 8px; font-size: 13px; font-weight: 700; }
.capacity-medium { color: var(--warning); background: var(--warning-bg); padding: 8px 10px; border-radius: 8px; }
.consent-row { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 0 0 16px; }
.consent-row input { margin-top: 4px; }
.info-card { padding: 28px; position: sticky; top: 24px; }
.info-card h2 { font-size: 17px; margin-bottom: 4px; }
.info-card p { color: var(--muted); font-size: 14px; margin-bottom: 24px; }
.info-number { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-blue); color: #fff; font-weight: 900; margin-bottom: 10px; }

.modal { position: fixed; inset: 0; z-index: 1000; display: none; align-items: center; justify-content: center; padding: 18px; background: rgba(11, 24, 45, .72); }
.modal.is-open { display: flex; }
.modal-panel { width: min(1100px, 100%); height: min(850px, calc(100vh - 36px)); background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 24px 80px rgba(0,0,0,.28); display: flex; flex-direction: column; }
.modal-header { min-height: 70px; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.modal-header div { display: flex; flex-direction: column; }
.modal-header span { color: var(--muted); font-size: 12px; }
.modal-close { width: 42px; height: 42px; border: 0; border-radius: 50%; background: #edf2f7; font-size: 28px; cursor: pointer; }
.modal-alert { padding: 11px 18px; background: var(--danger-bg); color: var(--danger); border-bottom: 1px solid #f7c8c4; font-weight: 750; }
.modal iframe { width: 100%; flex: 1; border: 0; min-height: 650px; }

.status-card { text-align: center; }
.status-icon { width: 70px; height: 70px; margin: 0 auto 20px; border-radius: 50%; display: grid; place-items: center; font-size: 34px; font-weight: 900; }
.status-icon-success { color: var(--success); background: var(--success-bg); }
.status-icon-error { color: var(--danger); background: var(--danger-bg); }

.admin-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.admin-heading h1 { margin-bottom: 6px; }
.admin-heading p { color: var(--muted); margin-bottom: 0; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--text); display: flex; flex-direction: column; box-shadow: 0 7px 18px rgba(31,45,61,.05); }
.stat-card span { color: var(--muted); font-size: 13px; }
.stat-card strong { font-size: 32px; line-height: 1.1; margin-top: 4px; }
.stat-card.active { outline: 2px solid var(--brand-blue); }
.stat-pending strong { color: var(--warning); }
.stat-confirmed strong { color: var(--success); }
.admin-create-card { padding: 24px; margin-bottom: 24px; }
.admin-create-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-submit { justify-content: flex-end; }
.table-card { overflow: hidden; }
.table-heading { padding: 20px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.table-heading h2 { margin: 0; }
.table-heading span { color: var(--muted); font-size: 13px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 1080px; }
th, td { text-align: left; padding: 15px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f7f9fc; color: #475467; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
td { font-size: 13px; }
td strong, td span, td small { display: block; }
td small { color: var(--muted); margin-top: 3px; }
.badge { display: inline-flex; width: fit-content; padding: 4px 8px; border-radius: 999px; font-weight: 800; font-size: 11px; }
.badge-confirmed { color: var(--success); background: var(--success-bg); }
.badge-pending { color: var(--warning); background: var(--warning-bg); }
.link-cell { min-width: 310px; }
.link-cell input { font-size: 11px; padding: 8px; margin-bottom: 7px; }
.actions-cell { white-space: nowrap; }
.actions-cell form { margin-bottom: 5px; }
.link-button { border: 0; background: none; padding: 0; color: var(--brand-blue); text-decoration: underline; cursor: pointer; font-size: 12px; }
.link-danger { color: var(--danger); }
.muted { color: var(--muted); }
.empty-table { padding: 38px; text-align: center; color: var(--muted); }

@media (max-width: 900px) {
    .header-title { display: none; }
    .admin-nav { gap: 10px; font-size: 12px; }
    .customer-layout { grid-template-columns: 1fr; }
    .info-card { position: static; display: grid; grid-template-columns: 40px 1fr; column-gap: 10px; }
    .info-card h2 { align-self: center; }
    .info-card p { grid-column: 2; }
    .stats-grid { grid-template-columns: 1fr; }
    .admin-create-form { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
    .container { width: min(100% - 20px, 1180px); }
    .main-content { padding-top: 22px; }
    .header-inner { min-height: 72px; gap: 10px; }
    .brand img { max-width: 200px; width: 54vw; }
    .admin-nav a:not(:last-child) { display: none; }
    .footer-inner { align-items: flex-start; flex-direction: column; justify-content: center; padding: 16px 0; }
    .form-grid, .customer-summary, .admin-create-form { grid-template-columns: 1fr; }
    .field-wide { grid-column: auto; }
    .customer-card, .narrow-card { padding: 22px; }
    .admin-heading { align-items: flex-start; flex-direction: column; }
    .modal { padding: 0; }
    .modal-panel { height: 100vh; border-radius: 0; }
    .modal iframe { min-height: 0; }
}

/* Katalog kování – veřejná objednávka */
.customer-page .header-inner { justify-content: flex-start; }
.customer-page .header-title { margin-left: 0; }
.customer-page .customer-card { overflow: hidden; }
.customer-intro {
    margin: calc(clamp(24px, 5vw, 44px) * -1);
    margin-bottom: 30px;
    padding: clamp(28px, 5vw, 46px);
    padding-bottom: 32px;
    background: linear-gradient(135deg, #ffffff 0%, #f4f8fc 100%);
    border-bottom: 1px solid var(--line);
}
.customer-intro .lead { max-width: 700px; margin-bottom: 0; }
.form-section-heading { margin: 0 0 16px; }
.form-section-heading h2 { margin-bottom: 3px; font-size: 19px; }
.form-section-heading p { margin-bottom: 0; color: var(--muted); font-size: 13px; }
.catalog-contact-form { margin-bottom: 26px; }
.form-section-title { margin: 4px 0 12px; }
.consent-box {
    padding: 15px;
    border: 1px solid #cbd8e6;
    border-radius: 11px;
    background: #f8fbfe;
}
.privacy-note { color: var(--muted); font-size: 12px; margin-bottom: 16px; }
.honeypot { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.public-link-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(420px, .9fr);
    gap: 24px;
    align-items: center;
    padding: 22px 24px;
    margin-bottom: 24px;
}
.public-link-card h2 { margin-bottom: 4px; }
.public-link-card p { margin-bottom: 0; color: var(--muted); font-size: 14px; }
.public-link-copy { display: flex; gap: 10px; }
.public-link-copy input {
    min-width: 0;
    flex: 1;
    border: 1px solid #cfd8e3;
    border-radius: 10px;
    padding: 11px 12px;
    color: var(--text);
    background: #fff;
}
.catalog-table { min-width: 980px; }

@media (max-width: 900px) {
    .public-link-card { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .public-link-copy { flex-direction: column; }
}
