:root {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --text: #1b1f24;
    --muted: #5f6873;
    --faint: #b9c0c8;
    --line: #e2e5e9;
    --accent: #c2410c;
    --accent-text: #ffffff;
    --accent-soft: #fde7da;
    --select: #1d4ed8;
    --select-soft: #dbe6ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 4px 16px rgba(0, 0, 0, .05);
    --radius: 10px;
    color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #111418;
        --surface: #1a1e24;
        --text: #e8eaed;
        --muted: #9aa3ad;
        --faint: #4a525c;
        --line: #2b3139;
        --accent: #f97316;
        --accent-text: #1a1009;
        --accent-soft: #3a2314;
        --select: #7aa2ff;
        --select-soft: #1f2d4d;
        --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: inherit; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 10px; }

/* ---------- toolbar ---------- */
.toolbar {
    position: sticky; top: 0; z-index: 10;
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; font-size: 20px; text-decoration: none; letter-spacing: -.01em; }
.brand span { color: var(--accent); }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 38px; padding: 0 14px;
    border: 1px solid var(--line); border-radius: 8px;
    background: var(--surface); color: var(--text);
    font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
    white-space: nowrap;
}
.btn:hover { border-color: var(--faint); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover { filter: brightness(1.08); border-color: var(--accent); }
.btn-ghost { background: transparent; }
/* "Sold out" in place of "Buy tickets": same size, grey, not clickable */
.btn-soldout, .btn-soldout:hover {
    background: #e2e5e9; border-color: #e2e5e9; color: #5f6873; cursor: default;
}
@media (prefers-color-scheme: dark) {
    .btn-soldout, .btn-soldout:hover { background: #2b3139; border-color: #2b3139; color: #9aa3ad; }
}
.link { background: none; border: 0; padding: 0; color: var(--select); font: inherit; cursor: pointer; text-decoration: underline; }
:focus-visible { outline: 2px solid var(--select); outline-offset: 2px; }

/* ---------- layout ---------- */
.layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 16px 40px;
    align-items: start;
}
.sidebar { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 76px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.filters-toggle { display: none; }

/* ---------- calendar ---------- */
.cal-nav { display: flex; align-items: center; gap: 2px; margin-bottom: 8px; }
.cal-title { flex: 1; text-align: center; font-weight: 700; }
.cal-arrow {
    width: 32px; height: 32px; border: 0; border-radius: 6px;
    background: transparent; color: var(--text); font-size: 20px; line-height: 1; cursor: pointer;
}
.cal-arrow:hover:not(:disabled) { background: var(--bg); }
.cal-arrow:disabled { color: var(--faint); cursor: default; }

.cal { user-select: none; -webkit-user-select: none; }  /* Shift+click must not select text */
.cal-grid { display: grid; grid-template-columns: 30px repeat(7, 1fr); gap: 2px; }
.cal-grid > * {
    height: 34px; display: flex; align-items: center; justify-content: center;
    border: 0; border-radius: 6px; background: transparent; color: var(--text);
    font: inherit; font-size: 14px; padding: 0;
}
.cal-corner { font-size: 11px !important; color: var(--muted) !important; }
.cal-head { font-size: 12px !important; font-weight: 700; color: var(--muted) !important; cursor: pointer; }
.cal-week { font-size: 11px !important; color: var(--muted) !important; cursor: pointer; background: var(--bg) !important; }
.cal-day { cursor: pointer; font-weight: 600; }
.cal-day:disabled, .cal-head:disabled, .cal-week:disabled { color: var(--faint) !important; font-weight: 400; cursor: default; }
.cal-head:hover:not(:disabled), .cal-week:hover:not(:disabled), .cal-day:hover:not(:disabled) { background: var(--select-soft) !important; }
.cal-day.is-today { box-shadow: inset 0 0 0 1px var(--accent); }
.cal-day.is-selected:not(:disabled) { background: var(--select); color: #fff; }
.cal-day.is-selected:disabled { background: var(--select-soft); }
.cal-head.is-active, .cal-week.is-active { background: var(--select) !important; color: #fff !important; }
.cal-selection { margin: 10px 0 0; font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }

/* ---------- categories ---------- */
.cats, .cats ul { list-style: none; margin: 0; padding: 0; }
.cats ul { padding-left: 24px; }
.cats-all { border-bottom: 1px solid var(--line); margin-bottom: 4px; padding-bottom: 4px; font-weight: 600; }
.cats label { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; }
.cats input { width: 17px; height: 17px; accent-color: var(--select); margin: 0; }

/* ---------- search ---------- */
.search { display: flex; gap: 8px; }
.search input {
    flex: 1; min-width: 0; min-height: 38px; padding: 0 10px;
    border: 1px solid var(--line); border-radius: 8px;
    background: var(--bg); color: var(--text); font: inherit;
}

/* ---------- tiles ---------- */
.results-head { margin: 0 0 12px; color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; transition: opacity .15s; }
.tiles.is-loading { opacity: .5; }
.tile {
    display: flex; flex-direction: column;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow);
    position: relative;
    transition: transform .28s cubic-bezier(.2, .8, .3, 1), box-shadow .28s ease, border-color .28s ease;
}
/* Picture area: thumbnail top left, date top right, event type bottom right */
.tile-pic { position: relative; aspect-ratio: 16 / 9; display: flex; align-items: flex-end; justify-content: flex-end;
            padding: 12px; color: #fff; overflow: hidden; }

/* ---------- tile hover effects (one picked at random by app.js) ---------- */
.tile[class*="fx-"] { z-index: 1; box-shadow: 0 14px 32px rgba(0, 0, 0, .18); }
/* Lift: rises off the page */
.tile.fx-lift { transform: translateY(-8px); }
/* Tilt: leans in 3D towards a random corner (--tilt-x/y set by app.js) */
.tile.fx-tilt { transform: perspective(900px) rotateX(var(--tilt-x, 5deg)) rotateY(var(--tilt-y, -5deg)) scale(1.02); }
/* Pop: quick springy bounce, then stays slightly larger */
.tile.fx-pop { animation: tile-pop .45s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes tile-pop {
    0%   { transform: scale(1); }
    45%  { transform: scale(1.06); }
    75%  { transform: scale(1.015); }
    100% { transform: scale(1.03); }
}
/* Shine: a light sweep crosses the picture, accent border */
.tile.fx-shine { transform: translateY(-3px); border-color: var(--accent); }
.tile-pic::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .5) 50%, transparent 70%);
    transform: translateX(-110%);
}
.tile.fx-shine .tile-pic::after { animation: tile-shine .75s ease-out; }
@keyframes tile-shine { to { transform: translateX(110%); } }

@media (prefers-reduced-motion: reduce) {
    .tile { transition: none; }
}
/* Square, as tall as the picture area minus the 10px gap above and below */
.tile-thumb {
    position: absolute; top: 10px; left: 10px; z-index: 1;
    height: calc(100% - 20px); aspect-ratio: 1 / 1; border-radius: 12px; overflow: hidden;
    container-type: size;   /* lets the initials scale with the square */
    display: flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, .18); border: 2px solid rgba(255, 255, 255, .55);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.tile-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-thumb-initials { font-size: 48px; font-size: 38cqh; font-weight: 800; letter-spacing: .02em; text-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
/* The square thumbnail takes about 56% of the width (16:9 area); a long
   type name wraps instead of running under it */
.tile-pic-label { position: relative; z-index: 1; max-width: 40%; text-align: right; overflow-wrap: anywhere; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; opacity: .9; }
.cat-music      { background: linear-gradient(135deg, #312e81, #7c3aed 60%, #c084fc); }
.cat-theatrical { background: linear-gradient(135deg, #7f1d1d, #be123c 60%, #fb7185); }
.cat-speaker    { background: linear-gradient(135deg, #064e3b, #0f766e 60%, #2dd4bf); }
.tile-pic:not(.cat-music):not(.cat-theatrical):not(.cat-speaker) { background: linear-gradient(135deg, #334155, #64748b); }
.tile-date {
    position: absolute; top: 10px; right: 10px;
    display: flex; flex-direction: column; align-items: center;
    min-width: 46px; padding: 4px 6px; border-radius: 8px;
    background: rgba(255, 255, 255, .95); color: #1b1f24; line-height: 1.1;
}
.tile-date-day { font-size: 20px; font-weight: 800; }
.tile-date-mon { font-size: 11px; font-weight: 700; text-transform: uppercase; color: #c2410c; }

.tile-body { display: flex; flex-direction: column; flex: 1; padding: 12px 14px 14px; }
.tile-name { margin: 0; font-size: 17px; line-height: 1.25; }
.tile-performer { margin: 2px 0 0; color: var(--accent); font-weight: 600; font-size: 14px; }
.tile-summary { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.tile-meta { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 10px 0 12px; font-size: 13px; }
.tile-meta dt { color: var(--muted); }
.tile-meta dd { margin: 0; }
.tile-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.tile-price { font-weight: 700; display: flex; flex-direction: column; line-height: 1.2; }
.tile-few { font-size: 12px; font-weight: 600; color: var(--accent); }
.tile-actions { display: flex; gap: 6px; }

/* ---------- event / placeholder pages ---------- */
.page { max-width: 900px; margin: 0 auto; padding: 20px 16px 40px; }
.back { display: inline-block; margin-bottom: 14px; color: var(--muted); }
.event-hero { border-radius: var(--radius); aspect-ratio: 21 / 9; display: flex; align-items: flex-end; padding: 20px; color: #fff; overflow: hidden; position: relative; }
/* Description with the poster beside it (below it on narrow screens) */
.event-body.has-poster { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 320px); gap: 24px; align-items: start; }
.event-poster { display: block; width: 100%; height: auto; border-radius: var(--radius); margin-top: 16px; }
@media (max-width: 640px) { .event-body.has-poster { grid-template-columns: 1fr; } }
.event-hero h1 { margin: 0; font-size: clamp(24px, 5vw, 38px); position: relative; text-shadow: 0 1px 8px rgba(0, 0, 0, .3); }
.event-hero p { margin: 4px 0 0; position: relative; font-weight: 600; }
.event-desc { font-size: 16px; margin: 18px 0; }
.perf-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.perf-list li {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px;
}
.perf-when { font-weight: 700; }
.perf-where { color: var(--muted); font-size: 14px; }
.notice { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }

/* ---------- toolbar: user, Log in/out, language menu ---------- */
.toolbar-right { display: flex; align-items: center; gap: 10px; }
.toolbar-right form { margin: 0; }

.lang-menu { position: relative; }
.lang-current {
    display: inline-flex; align-items: center; gap: 7px;
    min-height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px;
    background: transparent; color: var(--text); font: inherit; font-weight: 600; cursor: pointer;
}
.lang-current:hover { border-color: var(--faint); }
.lang-caret { transition: transform .75s cubic-bezier(.2, .8, .2, 1); }
.lang-menu.is-open .lang-caret { transform: rotate(180deg); }
/* Opens over ~0.75s: unfolds downwards while fading in */
.lang-list {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 20;
    min-width: 100%; margin: 0; padding: 6px; list-style: none;
    background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .16);
    transform-origin: top right;
    opacity: 0; visibility: hidden; transform: translateY(-6px) scaleY(.4);
    clip-path: inset(0 0 100% 0 round 10px);
    transition: opacity .75s ease, transform .75s cubic-bezier(.2, .8, .2, 1),
                clip-path .75s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .75s;
}
.lang-menu.is-open .lang-list {
    opacity: 1; visibility: visible; transform: none; clip-path: inset(0 0 0 0 round 10px);
    transition: opacity .75s ease, transform .75s cubic-bezier(.2, .8, .2, 1),
                clip-path .75s cubic-bezier(.2, .8, .2, 1), visibility 0s;
}
.lang-list a {
    display: block; padding: 8px 14px; border-radius: 6px; white-space: nowrap;
    text-decoration: none; color: var(--text); font-weight: 500;
}
.lang-list a:hover, .lang-list a:focus-visible { background: var(--bg); outline: none; }
.lang-list a.is-current { font-weight: 700; color: var(--select); }
.lang-list a.is-current::after { content: " \2713"; }
@media (prefers-reduced-motion: reduce) {
    .lang-list, .lang-menu.is-open .lang-list, .lang-caret { transition: none; }
}
/* Narrow phones: logo, Log out and the language button only */
@media (max-width: 480px) {
    .toolbar-name { display: none; }
    .toolbar-right { gap: 6px; }
}

/* ---------- dashboard ---------- */
.toolbar-name { font-weight: 600; text-decoration: none; }
.toolbar-name:hover { text-decoration: underline; }
.notice h2 { margin-bottom: 8px; }
.notice-ok { border-color: #27ae60; color: #1e7e46; margin-bottom: 14px; padding: 12px 16px; }
.notice-err { border-color: #e3a49c; color: #b03a2e; margin: 0 0 14px; padding: 12px 16px; }
.notice-cancelled { border-color: #e3a49c; color: #b03a2e; font-weight: 600; margin: 0 0 16px; padding: 12px 16px; }
/* The event editor's previews: the event page ("Preview Event") and one tile in a dialog ("Preview Tile") */
.notice-preview { border-color: #7c3aed; color: #5b21b6; font-weight: 600; margin: 0 0 16px; padding: 12px 16px; }
@media (prefers-color-scheme: dark) { .notice-preview { color: #c4b5fd; } }
.preview-dialog { border: 0; border-radius: var(--radius); padding: 20px; background: var(--bg); color: var(--text); max-width: calc(100vw - 32px); }
.preview-dialog::backdrop { background: rgba(0, 0, 0, .45); }
.preview-dialog .tiles { grid-template-columns: min(340px, calc(100vw - 72px)); }
.preview-dialog-event { width: min(1100px, calc(100vw - 32px)); }
.preview-dialog-event iframe { display: block; width: 100%; height: min(78vh, 900px); border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
/* Event page: the status with Publish / Suspend */
.event-status { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 16px; }
.event-status form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0; }
.event-status.status-published { border-color: #27ae60; }
.event-status.status-cancelled { border-color: #e3a49c; }
.preview-dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 12px; }
.preview-dialog-head h2 { margin: 0; font-size: 16px; }

/* ---------- sign-in pages: same design as the Rummikub login ---------- */
/* Fixed colours on purpose: the card looks the same in light and dark mode */
body.auth-page {
    min-height: 100vh; margin: 0; padding: 16px;
    display: flex; align-items: center; justify-content: center;
    background: #2c3e50; color: #333;
    font-family: Arial, sans-serif;
    color-scheme: light;
}
.auth-card {
    background: #fff; padding: 30px; border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .3);
    width: 320px; max-width: 100%;
}
.auth-card h2 {
    margin: 0 0 20px; color: #333; text-align: center;
    font-size: 1.5em; text-transform: none; letter-spacing: normal;
}
.auth-card form { margin: 0; }
.auth-card input {
    display: block; width: 100%; padding: 10px; margin: 0 0 15px;
    border: 1px solid #ccc; border-radius: 4px;
    font: 13.333px Arial, sans-serif; color: #333; background: #fff;
}
.auth-card input:focus { outline: none; border-color: #2980b9; box-shadow: 0 0 0 2px rgba(41, 128, 185, .25); }
.auth-card button[type=submit]:not(.link) {
    width: 100%; padding: 10px; border: none; border-radius: 4px;
    background: #27ae60; color: #fff; font: inherit; font-size: 16px; cursor: pointer;
}
.auth-card button[type=submit]:not(.link):hover { background: #229954; }
.auth-card button[type=submit].is-busy:not(.link) { background: #7f8c8d; cursor: wait; }
.auth-card .hint { font-size: 13px; color: #7a858c; margin: 0 0 12px; text-align: center; }
.auth-msg { margin: 10px 0 0; text-align: center; color: #c0392b; font-size: 13px; font-weight: bold; }
.auth-ok  { margin: 0 0 15px; text-align: center; color: #1e8449; font-size: 13px; font-weight: bold; }
.auth-link { text-align: center; font-size: 13px; color: #666; margin: 12px 0 0; }
.auth-link a, .auth-link .link { color: #2980b9; font-size: 13px; }

/* ---------- administrator pages ---------- */
/* Fixed divider: feature list 220px, the active feature takes the rest */
.admin { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100vh - 59px); }
.admin-nav { background: var(--surface); border-right: 1px solid var(--line); padding: 20px 12px; }
.admin-nav ul { list-style: none; margin: 0; padding: 0; position: sticky; top: 76px; }
.admin-nav h2 { padding: 0 10px; }
.admin-nav a {
    display: block; padding: 9px 12px; margin-bottom: 2px; border-radius: 8px;
    text-decoration: none; font-weight: 600; color: var(--text);
}
.admin-nav a:hover { background: var(--bg); }
.admin-nav a.is-active { background: var(--select); color: #fff; }
.admin-main { padding: 20px 24px 48px; max-width: 1100px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.admin-head h1 { margin: 0; font-size: 24px; }
.admin-main > .panel, .admin-main .cat-list > .panel { margin-bottom: 16px; }
.admin-main .panel h2 { margin-bottom: 12px; }
.admin-main .panel h2 .count { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: 6px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.empty { color: var(--muted); padding: 20px 0; }

.flash { padding: 10px 14px; border-radius: 8px; margin: 0 0 14px; font-weight: 600; }
.flash-ok  { background: #e3f6ea; color: #1e7e46; border: 1px solid #b6e3c6; }
.flash-err { background: #fdecea; color: #a82a1d; border: 1px solid #f5c2bc; }
@media (prefers-color-scheme: dark) {
    .flash-ok  { background: #10301e; color: #7ee2a8; border-color: #1e5a37; }
    .flash-err { background: #3a1512; color: #ff9b8f; border-color: #6b2a23; }
}

/* search / filter row above lists */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters input[type=search] { flex: 1 1 260px; }

/* inputs on admin pages */
.admin-main input:not([type=checkbox]):not([type=radio]):not([type=hidden]), .admin-main select, .admin-main textarea {
    min-height: 38px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px;
    background: var(--bg); color: var(--text); font: inherit; max-width: 100%;
}
.admin-main textarea { width: 100%; resize: vertical; }
.admin-main [aria-invalid=true] { border-color: #d0453a; }
.admin-main input.short, .admin-main select.short { width: 8em; }

.form-grid { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px 16px; align-items: start; }
.form-grid > label, .form-grid > .label { padding-top: 9px; font-weight: 600; }
.form-grid input:not([type=checkbox]):not([type=radio]), .form-grid select { width: min(100%, 420px); }
.form-grid .inline-fields input { width: 7.5em; }
.form-grid .value { margin: 9px 0 0; }
.form-grid [hidden] { display: none !important; }
.form-grid [data-new-vendor] { margin-top: 8px; display: block; }
.hint { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.field-err { margin: 4px 0 0; font-size: 13px; color: #d0453a; font-weight: 600; }
.check { display: inline-flex; gap: 8px; align-items: center; padding-top: 9px; }
.check input { width: 17px; height: 17px; accent-color: var(--select); }
.form-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; }
.button-row form { margin: 0; }
.btn-danger { color: #c0392b; border-color: #e3a49c; }
.btn-danger:hover { background: #c0392b; color: #fff; border-color: #c0392b; }
.btn.is-disabled, .btn:disabled { opacity: .45; pointer-events: none; }
.danger-zone { border-color: #e3a49c; }
.danger-zone p { margin-top: 0; }
.form-grid > .span-all { grid-column: 1 / -1; margin: 0; }
/* A panel with fields one under the other (vendor: change company, close account) */
.stack label { display: block; font-weight: 600; margin: 14px 0 4px; }
.stack input:not([type=checkbox]):not([type=radio]), .stack select { width: min(100%, 420px); }
.stack .button-row { margin-top: 18px; }
ul.plain { margin: 0 0 10px; padding-left: 18px; }

/* tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--surface); }
.admin-main > .table-wrap { border: 1px solid var(--line); border-radius: var(--radius); }
table.data th, table.data td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--bg); }
table.data tr:last-child td { border-bottom: 0; }
table.data .num { text-align: right; }
table.data tr.is-inactive td { color: var(--muted); }
table.data td.ua { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 10px; font-size: 11px; font-weight: 700;
         background: var(--select-soft); color: var(--select); vertical-align: 1px; }
.badge-off { background: #fdecea; color: #a82a1d; }
.status { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.status-published { background: #e3f6ea; color: #1e7e46; }
.status-draft     { background: var(--select-soft); color: var(--select); }
.status-cancelled { background: #fdecea; color: #a82a1d; }
/* Support requests (requirements 2.3.3) */
.status-req-new    { background: #fff3cd; color: #8a5a00; }
.status-req-open   { background: var(--select-soft); color: var(--select); }
.status-req-closed { background: #eceff3; color: var(--muted); }
h1 .status { vertical-align: 4px; margin-left: 6px; }
.nav-count { display: inline-block; min-width: 20px; margin-left: 6px; padding: 0 6px; border-radius: 10px; background: #e67e22; color: #fff;
             font-size: 12px; font-weight: 700; text-align: center; }
.admin-nav .support-btn { margin-top: 16px; width: 100%; justify-content: center; text-align: center; }
.facts { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 6px 14px; margin: 0 0 12px; }
.facts dt { font-weight: 600; color: var(--muted); }
.facts dd { margin: 0; }
.thread { list-style: none; margin: 0; padding: 0; }
.thread .msg { border-left: 3px solid var(--line); padding: 6px 14px; margin: 12px 0; }
.thread .msg.from-admin { border-left-color: #27ae60; }
.thread .msg-meta { margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.thread .msg-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.stack textarea, .form-grid textarea { width: min(100%, 640px); }

/* ---------- venue form ---------- */
.form-grid .form-section { grid-column: 1 / -1; margin: 10px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.form-grid > .form-section:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.check.radio { display: flex; padding-top: 6px; }
.check.radio input { accent-color: var(--select); }
/* Event editor, other languages: a section per language; a text field with its Suggest button (Claude) in the corner */
.form-section-lang { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.form-section-lang[hidden] { display: none; }
/* The language list and its buttons in the Event heading (not in the heading's capitals) */
.lang-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; text-transform: none; letter-spacing: normal; font-weight: 400; font-size: 14px; }
.lang-controls select { width: auto; min-height: 32px; }
.form-grid .form-section-hint { grid-column: 1 / -1; margin: -4px 0 4px; }
.lang-pane + .hint { margin-top: 4px; }
.suggest-field { position: relative; }
/* (as specific as the general .admin-main input rule, so these win) */
.admin-main .suggest-field [data-tr-field][lang] { width: 100%; padding-right: 40px; }
.suggest-field .btn-icon { position: absolute; right: 5px; top: 5px; min-height: 0; width: 28px; height: 28px; padding: 0; color: #7c3aed; }
.suggest-field .btn-icon.is-busy svg { animation: spin 1s linear infinite; }
.admin-main .suggest-field [data-tr-field][lang].is-suggested { border-color: #7c3aed; background: #f3eefe; }
@media (prefers-color-scheme: dark) { .admin-main .suggest-field [data-tr-field][lang].is-suggested { background: #24183d; } }
/* Seat prices (price-editor.js): a seat's colour is its price tier; grey = not for sale; striped = different
   prices in the ticked performances; dark = sold or held; selected: thick orange outline */
.price-map { cursor: crosshair; user-select: none; }
.hall-map.price-map .level-bg { fill: var(--surface); }
.price-map .price-seat { cursor: pointer; }
.hall-map .group .price-seat.is-price rect { fill: var(--price-colour, var(--select)); }
.hall-map .group .price-seat.is-none rect { fill: #c3c9d1; }
.hall-map .group .price-seat.is-none .seat-label { fill: #374151; }
.hall-map .group .price-seat.is-mixed rect { fill: #94a3b8; stroke-dasharray: 3 2; stroke: #475569; }
.hall-map .group .price-seat.is-sold rect { fill: #1f2937; }
.hall-map .group .price-seat.is-partsold rect { stroke: #1f2937; stroke-width: 3; }
.hall-map .group .price-seat.is-selected rect { stroke: #f97316; stroke-width: 4; }
.price-map .select-band { fill: rgba(249, 115, 22, .12); stroke: #f97316; stroke-width: 2; stroke-dasharray: 6 4; }
.price-panel { display: grid; gap: 8px; }
.price-panel .button-row { display: flex; gap: 8px; flex-wrap: wrap; }
.price-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.price-legend .swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-right: 6px; vertical-align: -2px; }
.price-legend .swatch.is-none { background: #c3c9d1; }
.price-legend .swatch.is-mixed { background: #94a3b8; outline: 1px dashed #475569; }
.price-legend .swatch.is-sold { background: #1f2937; }
.price-legend .swatch.is-partsold { background: transparent; border: 3px solid #1f2937; }
/* Wheelchair spaces: a white inner border (the price colour stays around it) */
.hall-map .group .price-seat rect.wheel-mark { fill: none; stroke: #fff; stroke-width: 2; }
.hall-map .price-seat .seat-label.wheel-label { font-size: 10px; }
.hall-map .group .price-seat.is-none rect.wheel-mark { stroke: #374151; }
.price-legend .swatch.is-wheel { background: var(--select); box-shadow: inset 0 0 0 2px var(--select), inset 0 0 0 4px #fff; }
.price-performances { display: grid; gap: 8px; }
.perf-checks { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.price-zones { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
/* Promo codes (event page): codes in a typewriter face; the add form opens under its button */
.promo-code, .promo-code-input { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .04em; }
.promo-code-input { text-transform: uppercase; }
.promo-add { margin-top: 12px; }
.promo-add > summary { list-style: none; display: inline-flex; }
.promo-add > summary::-webkit-details-marker { display: none; }
.promo-add[open] > summary { margin-bottom: 12px; }
.perf-checks-column { flex-direction: column; }
/* Event page: links to its sections further down */
.page-links { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 14px; }
.page-links .count { margin-left: 6px; color: var(--muted); font-weight: 400; }
html { scroll-behavior: smooth; }
/* A short number beside its unit (promo discount, price change): not the admin pages' full width */
.admin-main .inline-fields > input[type=number].short { width: 8em; flex: none; }
.admin-main .inline-fields > select { width: auto; flex: none; }
/* Adding performances: the chosen venue (read only) with "Choose Public" / "Create Private"; the venue search */
.venue-pick { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.admin-main .venue-pick > input[readonly] { flex: 1 1 260px; width: auto; background: var(--surface); }
.venue-dialog { width: min(820px, calc(100vw - 32px)); }
.venue-filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; margin-bottom: 8px; }
.venue-filters label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; }
.venue-filters input, .venue-filters select { min-height: 34px; }
.venue-filters input[type=number] { width: 7em; }
.venue-amenities { border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px 8px; margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.venue-amenities legend { font-size: 13px; font-weight: 600; padding: 0 4px; }
.venue-results { display: grid; gap: 10px; max-height: 60vh; overflow: auto; }
.venue-result { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--surface); }
.venue-result-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin-bottom: 6px; }
.venue-result-head .venue-details-btn { margin-left: auto; }
/* A venue's details (over the search) */
.venue-details-body { max-height: 70vh; overflow: auto; }
.venue-details h3 { margin: 0 0 6px; }
.venue-details .street-image { max-width: min(100%, 420px); }
.venue-contacts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 8px 0; }
.venue-contacts dt { font-weight: 600; }
.venue-contacts dd { margin: 0; overflow-wrap: anywhere; }
.venue-details-hall { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 12px; }
.venue-details-hall h4 { margin: 0 0 6px; }
.venue-details-level { margin: 6px 0; }
.venue-details-level ul { margin: 4px 0 0; padding-left: 20px; }
.venue-result-hall { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 4px 0; border-top: 1px dashed var(--line); }
.venue-result .badge { font-size: 12px; padding: 1px 7px; border-radius: 999px; background: #ede9fe; color: #5b21b6; }
/* Adding performances: one date and time field per line */
[data-starts] input[type=datetime-local] { display: block; margin-bottom: 6px; }
/* Event pictures on the event editor: the tile picture as a square, a poster at its own shape */
.event-tile-preview { display: block; width: 120px; height: 120px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); margin: 4px 0 8px; }
.event-poster-preview { display: block; max-width: min(100%, 220px); max-height: 300px; border-radius: 8px; border: 1px solid var(--line); margin: 4px 0 8px; }
.street-image { display: block; max-width: min(100%, 520px); border-radius: 8px; border: 1px solid var(--line); margin: 4px 0 8px; }
.form-grid input[type=file] { margin-top: 6px; }
.inline-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.inline-add input:not([type=hidden]) { flex: 1 1 180px; }
.inline-fields { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.admin-main input.tiny { width: 5.5em; }
.amenity-table { border-collapse: collapse; }
.amenity-table td { padding: 2px 8px 2px 0; }
.amenity-table .check { padding-top: 0; white-space: nowrap; }
.amenity-add { margin-top: 8px; }
.amenity-add-fields { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.amenity-add-fields[hidden] { display: none; }
.amenity-add-fields input[data-name] { flex: 1 1 200px; max-width: 320px; }
.btn-sm { min-height: 30px; padding: 0 10px; font-size: 13px; }

/* ---------- hall editor ---------- */
.seating { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 18px; align-items: start; }
.structure { font-size: 14px; max-height: 80vh; overflow: auto; padding-right: 4px; }
.structure details > summary { cursor: pointer; padding: 4px 0; }
.structure .lvl { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin-bottom: 10px; }
.structure .lvl > summary { font-size: 15px; }
.structure .tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 4px 0 8px; }
.structure .zone { border-left: 3px solid var(--line); padding: 4px 0 6px 10px; margin: 6px 0; border-radius: 2px; }
.structure .zone.is-selected, .structure li.is-selected { background: var(--select-soft); }
.structure .zone-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.structure details.edit > summary, .structure details.add > summary { color: var(--muted); font-size: 13px; }
.structure details.add > summary { color: var(--select); font-weight: 600; }
.structure .groups { list-style: none; margin: 2px 0; padding: 0; }
.structure .groups li { border-radius: 6px; padding: 0 6px; }
.structure .groups li summary { color: var(--text) !important; font-size: 14px !important; }
.mini-form, .gen-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 4px 0; }
.mini-form + form { display: inline-block; margin: 2px 0 6px; }
.gen-form { flex-direction: column; align-items: flex-start; background: var(--bg); padding: 8px 10px; border-radius: 8px; }
.gen-form label { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.gen-form .gen-kind { display: flex; gap: 14px; }
.gen-form input[name=labels] { width: 210px; }
.gen-form [hidden] { display: none !important; }
.structure h3.sub { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 16px 0 4px; }

.map-wrap { min-width: 0; }
.map-bar { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; margin-bottom: 6px; min-height: 20px; }
.map-status { font-weight: 600; color: var(--muted); }
.map-status.is-ok { color: #1e8449; }
.map-status.is-err { color: #c0392b; }
.map-status.is-warn { color: #b45309; }
.editor-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.hall-map .zone.is-new .body { stroke-dasharray: 10 6; }
.map-scroll { border: 1px solid var(--line); border-radius: 10px; overflow: auto; max-height: 82vh; background: var(--surface); }
.hall-map { display: block; width: 100%; height: auto; touch-action: none; user-select: none; -webkit-user-select: none; }
.hall-map:focus { outline: none; }
.hall-map:focus-visible { outline: 2px solid var(--select); outline-offset: -2px; }
.hall-map .map-bg { stroke: none; }
.hall-map .grid-line { stroke: var(--line); stroke-width: 1; }
.hall-map text { dominant-baseline: central; text-anchor: middle; font-family: inherit; pointer-events: none; }
.hall-map .item { cursor: grab; }
.hall-map .item:active { cursor: grabbing; }
.hall-map .seat rect { fill: var(--c); stroke: var(--surface); stroke-width: 2; }
.hall-map .seat.used rect { stroke: #111827; stroke-width: 2; }
.hall-map .seat-label { fill: #fff; font-size: 11px; font-weight: 700; }
.hall-map .row-label { fill: var(--c); font-size: 15px; font-weight: 800; }
.hall-map .table { fill: var(--surface); stroke: var(--c); stroke-width: 3; }
.hall-map .table-label { fill: var(--c); font-size: 14px; font-weight: 800; }
.hall-map .zone-frame { fill: none; stroke: var(--c); stroke-width: 1.5; stroke-dasharray: 6 5; opacity: .6; }
.hall-map .zone-tag { fill: var(--c); font-size: 13px; font-weight: 700; text-anchor: start; }
.hall-map .standing rect { fill: color-mix(in srgb, var(--c) 16%, transparent); stroke: var(--c); stroke-width: 2; stroke-dasharray: 10 6; }
.hall-map .zone-name { fill: var(--c); font-size: 18px; font-weight: 800; }
.hall-map .zone-sub { fill: var(--c); font-size: 13px; }
.hall-map .shape rect { fill: transparent; stroke: var(--faint); stroke-width: 1.5; stroke-dasharray: 5 4; }
.hall-map .shape-stage rect { fill: #374151; stroke: #374151; stroke-dasharray: none; }
.hall-map .shape-stage .shape-label { fill: #fff; font-size: 18px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.hall-map .shape-label { fill: var(--muted); font-size: 15px; font-weight: 600; }
.hall-map .shape-label rect { stroke: none; }
.hall-map .item.is-selected rect:not(.handle), .hall-map .item.is-selected circle { stroke: #f59e0b; stroke-width: 3; stroke-dasharray: none; }
.hall-map .handle { fill: #f59e0b; stroke: #fff; stroke-width: 2; cursor: nwse-resize; }
.hall-map .locked { opacity: .3; }
.badge-adjust { background: #fef3c7; color: #92400e; }
@media (prefers-color-scheme: dark) { .badge-adjust { background: #3b2a08; color: #fcd34d; } }
.seating-zone { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.seating-zone h3 { margin: 0 0 8px; font-size: 16px; }
.seating-zone .button-row { align-items: center; margin-bottom: 10px; }
form.inline { display: inline-block; margin: 0; }
.map-legend .dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: #2563eb; vertical-align: -1px; border: 2px solid var(--surface); }
.map-legend .dot.used { border-color: #111827; }

/* ---------- venue set-up: steps, level and zone editors ---------- */
.steps { display: flex; gap: 6px; flex-wrap: wrap; list-style: none; margin: 0 0 14px; padding: 0; counter-reset: step; font-size: 13px; }
.steps li { counter-increment: step; padding: 5px 12px 5px 8px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.steps li::before { content: counter(step); display: inline-block; width: 18px; height: 18px; line-height: 18px; text-align: center;
                    border-radius: 50%; background: var(--line); color: var(--text); font-weight: 700; margin-right: 6px; font-size: 11px; }
.steps li.is-done::before { content: "\2713"; background: #27ae60; color: #fff; }
.steps li.is-current { border-color: var(--select); color: var(--text); font-weight: 600; }
.steps li.is-current::before { background: var(--select); color: #fff; }
.steps a { color: inherit; }
.level-name { margin-bottom: 6px; }
.level-name[hidden], [data-names-label][hidden] { display: none !important; }
.level-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.level-tabs a { padding: 7px 14px; border-radius: 8px 8px 0 0; border: 1px solid var(--line); border-bottom: 0; text-decoration: none;
                background: var(--bg); font-weight: 600; }
.level-tabs a.is-active { background: var(--surface); color: var(--select); }

.editor { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; }
.editor-toolbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 10px; border-bottom: 1px solid var(--line);
                  position: sticky; top: 59px; z-index: 5; background: var(--surface); border-radius: var(--radius) var(--radius) 0 0; }
.tool-group-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 2px 0 8px; }
.tool { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 8px; min-width: 64px;
        border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; font-size: 11px;
        cursor: grab; user-select: none; touch-action: none; }
.tool:hover { border-color: var(--select); }
.tool svg { width: 40px; height: 28px; fill: var(--select-soft); stroke: var(--select); stroke-width: 1.5; }
.tool svg .fill-dark { fill: #374151; stroke: #374151; }
.tool svg .dashed { fill: none; stroke-dasharray: 3 2; }
.tool svg .table { fill: var(--surface); }
.tool svg text { fill: var(--select); stroke: none; font-size: 14px; font-weight: 700; }
.tool-ghost { position: fixed; z-index: 1000; pointer-events: none; opacity: .85; box-shadow: 0 6px 18px rgba(0,0,0,.25); cursor: grabbing; }
.editor-body { display: grid; grid-template-columns: minmax(0, 1fr) 260px; }
.editor-canvas { padding: 12px; min-width: 0; overflow: auto; max-height: 78vh; }
.editor-side { border-left: 1px solid var(--line); padding: 12px; font-size: 14px; }
.editor-side h3 { margin: 0 0 8px; font-size: 15px; }
.editor-side .help { margin: 0; padding-left: 18px; color: var(--muted); }
.editor-side .help li { margin-bottom: 6px; }
.side-form { display: flex; flex-direction: column; gap: 8px; }
.side-form label { display: flex; flex-direction: column; gap: 3px; font-weight: 600; font-size: 13px; }
.side-form label.check { flex-direction: row; align-items: center; font-weight: 500; }
.side-form [hidden], .editor-side [hidden] { display: none !important; }
.editor-side details.add { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 10px; }
.editor-side details.add summary { color: var(--select); font-weight: 600; cursor: pointer; }
.zone-props { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.zone-props label { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; font-size: 14px; }
.zone-props [hidden] { display: none !important; }
.zone-props .check { padding-top: 0; }
.zone-props .field-err { flex-basis: 100%; margin: 0; }
.small { font-size: 12px; }
.notice-bar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; padding: 10px 14px; margin-bottom: 14px;
              border: 1px solid #f5d38a; background: #fff8e6; border-radius: 8px; }
@media (prefers-color-scheme: dark) { .notice-bar { background: #2e2408; border-color: #6b5214; } }

.hall-map .level-bg { stroke: var(--faint); stroke-width: 2; }
.hall-map .zone .body { fill: color-mix(in srgb, var(--select) 12%, transparent); stroke: var(--select); stroke-width: 2.5; }
.hall-map .zone-standing .body { fill: color-mix(in srgb, #059669 14%, transparent); stroke: #059669; stroke-dasharray: 10 6; }
.hall-map .zone.is-adjustable .body { stroke: #d97706; }
.hall-map .zone .zone-name { fill: var(--text); font-size: 18px; font-weight: 800; }
.hall-map .zone .zone-sub { fill: var(--muted); font-size: 13px; }
/* A zone's label (name and seat count) can be selected and dragged on its own */
.hall-map .zone-label { cursor: move; }
.hall-map .zone-label .label-box { fill: transparent; stroke: none; }
.hall-map .zone-label.is-selected .label-box { fill: color-mix(in srgb, #f59e0b 9%, transparent); stroke: #f59e0b; stroke-width: 2; stroke-dasharray: 6 4; }
.hall-map .mini-seat { fill: var(--select); opacity: .55; pointer-events: none; }
.hall-map .zone-pending { fill: none; stroke: #f59e0b; stroke-width: 3; stroke-dasharray: 8 5; }
.hall-map .zone-outline { fill: color-mix(in srgb, var(--select) 6%, transparent); stroke: var(--select); stroke-width: 3; stroke-dasharray: 12 6; }
.hall-map .shape .body { fill: transparent; stroke: var(--faint); stroke-width: 1.5; stroke-dasharray: 5 4; }
.hall-map .shape-stage .body { fill: #374151; stroke: #374151; stroke-dasharray: none; }
.hall-map .shape-label .body { stroke: transparent; }
.hall-map .handle { fill: #f59e0b; stroke: #fff; stroke-width: 2; visibility: hidden; }
.hall-map .handle.corner { cursor: nwse-resize; }
.hall-map .handle.corner[data-handle=ne], .hall-map .handle.corner[data-handle=sw] { cursor: nesw-resize; }
.hall-map .handle.bend { fill: #fff; stroke: #d97706; stroke-width: 3; cursor: ns-resize; }
/* A curved zone's thickness (bottom edge middle) and any zone's rotate handle (above its top edge) */
.hall-map .handle.thick { fill: #d97706; stroke: #fff; stroke-width: 2; cursor: ns-resize; }
.hall-map .handle.rotate { fill: #fff; stroke: var(--select); stroke-width: 2.5; cursor: grab; }
.hall-map .zone .handle.corner { cursor: move; }
.hall-map .item:hover .handle, .hall-map .item.is-selected .handle { visibility: visible; }
.hall-map .handle { vector-effect: non-scaling-stroke; }   /* the level editor shows small levels larger: handles keep their size */
.hall-map .item.is-selected .body { stroke: #f59e0b; stroke-width: 3.5; }
.hall-map .group-table .table { fill: var(--surface); stroke: var(--select); stroke-width: 3; }
.hall-map .group .seat rect { fill: var(--select); }
.hall-map .seat-label.small { font-size: 8px; }
.hall-map .row-label { fill: var(--select); }
.hall-map .table-label { fill: var(--select); }
/* Selected rows, tables and chairs: their box shows it; the seats keep their size */
.hall-map .item.is-selected .seat rect { stroke: var(--surface); stroke-width: 2; stroke-dasharray: none; }
.hall-map .item.is-selected .seat.used rect { stroke: #111827; }
.hall-map rect.item-box { fill: transparent; stroke: none; }
.hall-map .item:hover rect.item-box { fill: color-mix(in srgb, var(--select) 7%, transparent); }
.hall-map .copy-ghost { opacity: .55; pointer-events: none; }
.hall-map .item.is-drop-target rect.item-box { fill: color-mix(in srgb, #16a34a 12%, transparent); stroke: #16a34a; stroke-width: 3; stroke-dasharray: none; }
.hall-map .item.is-selected rect.item-box { fill: color-mix(in srgb, #f59e0b 9%, transparent); stroke: #f59e0b; stroke-width: 2; stroke-dasharray: 6 4; }
.hall-map .item.is-selected .table { stroke: #f59e0b; }
/* Aisles: a light walkway with dashed edges, under the chairs */
.hall-map .aisle { fill: color-mix(in srgb, var(--faint) 22%, transparent); stroke: var(--faint); stroke-width: 1.5; stroke-dasharray: 8 6; }
.hall-map .aisle-label { fill: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .08em; }
.hall-map .item.is-selected .aisle { stroke: #f59e0b; stroke-width: 3; stroke-dasharray: none; }
.hall-map .mini-aisle { fill: color-mix(in srgb, var(--faint) 30%, transparent); stroke: none; pointer-events: none; }
/* Seats are rounded squares with their number: chairs blue, wheelchair spaces green */
.hall-map .group .seat.wheelchair rect { fill: #16a34a; }
.hall-map .mini-seat.wheelchair { fill: #16a34a; opacity: .8; }
/* Chair numbers on the level, once the chairs are large enough on the screen (zoomed in) */
.hall-map .mini-row-label { fill: var(--muted); font-weight: 800; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.hall-map .mini-seat-number { fill: #0f172a; font-weight: 700; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.tool svg .seat-chair { fill: var(--select); stroke: none; }
.tool svg .axis { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 3 2; }
.tool svg .outline { fill: none; stroke: var(--select); stroke-width: 1.5; }
.tool svg .seat-wheel { fill: #16a34a; stroke: none; }
/* Doors: a green bar in the wall, its label beside it */
.hall-map .shape-door .body { fill: #16a34a; stroke: #15803d; stroke-width: 1.5; stroke-dasharray: none; }
.hall-map .door-label { fill: #15803d; font-size: 13px; font-weight: 700; }
.tool svg .wall { stroke: var(--muted); stroke-width: 2; }
.tool svg .door { fill: #16a34a; stroke: none; }
.tool svg .door-swing { fill: none; stroke: #16a34a; stroke-width: 1.5; stroke-dasharray: 2 2; }
.tool svg .aisle { fill: color-mix(in srgb, var(--faint) 35%, transparent); stroke: var(--faint); stroke-dasharray: 2 2; }
@media (max-width: 1000px) {
    .editor-body { grid-template-columns: minmax(0, 1fr); }
    .editor-side { border-left: 0; border-top: 1px solid var(--line); }
}

/* sortable headers and a filter box under each */
table.data-sortable th a.sort { color: inherit; text-decoration: none; display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
table.data-sortable th a.sort:hover { color: var(--text); }
table.data-sortable th a.sort.is-sorted { color: var(--select); }
.sort-arrow { font-size: 9px; }
table.data .filter-row th { padding: 6px 8px; background: var(--surface); text-transform: none; letter-spacing: 0; }
.admin-main table.data .filter-row input, .admin-main table.data .filter-row select {
    width: 100%; min-width: 90px; min-height: 32px; padding: 4px 8px; font-size: 13px;
}
.filter-actions { display: flex; gap: 12px; align-items: center; margin-top: 10px; font-size: 14px; }
td.empty { text-align: center; padding: 20px; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; color: var(--muted); font-size: 14px; }

/* temporary password, shown once */
.temp-password { border: 2px solid #27ae60; border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; background: var(--surface); }
.temp-password p { margin: 0 0 8px; }
.temp-password code { font-size: 22px; font-weight: 700; letter-spacing: .06em; margin-right: 10px; user-select: all; }

/* event types */
.cat-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; }
.cat-row form { margin: 0; }
.cat-edit { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; flex: 1 1 auto; }
.cat-edit input[name=name] { flex: 1 1 200px; }
.cat-row.is-type .cat-edit input[name=name] { font-weight: 700; }
/* The name in the other languages: highlighted while missing; a suggestion (Claude) until saved */
.cat-edit .cat-tr-field { position: relative; display: flex; flex: 0 1 140px; width: 140px; min-width: 0; }
.cat-edit input.cat-tr { flex: 1 1 auto; width: 100%; min-width: 0; }
/* Suggestion button (Claude) inside an empty field, at its right end */
.cat-tr-field .btn-icon {
    position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
    min-height: 0; width: 28px; height: 28px; padding: 0; color: #7c3aed;
}
.cat-tr-field .btn-icon[hidden] { display: none; }
/* Remove (trash bin icon): square, as high as the row's other buttons */
.cat-row .cat-remove { width: 38px; padding: 0; }
.cat-tr-field .btn-icon.is-busy svg { animation: spin 1s linear infinite; }
.admin-main .cat-tr-field input.cat-tr.is-missing { padding-right: 36px; }
@keyframes spin { to { transform: rotate(360deg); } }
.cat-edit input[name=name] { min-width: 0; }
.admin-main .cat-edit input.cat-tr.is-missing { border-color: #e0a800; background: #fff8e1; }
.admin-main .cat-edit input.cat-tr.is-suggested { border-color: #7c3aed; background: #f3eefe; }
@media (prefers-color-scheme: dark) {
    .admin-main .cat-edit input.cat-tr.is-missing { background: #2e2408; }
    .admin-main .cat-edit input.cat-tr.is-suggested { background: #24183d; }
}
.cat-children { margin-left: 28px; padding-left: 14px; border-left: 2px solid var(--line); }
.cat-add input[name=name] { flex: 1 1 200px; }
.cat-info { font-size: 13px; white-space: nowrap; min-width: 5.5em; text-align: right; }

/* ---------- phone ---------- */
@media (max-width: 760px) {
    .layout { grid-template-columns: 1fr; gap: 12px; padding-top: 12px; }
    .filters-toggle { display: flex; width: 100%; }
    .sidebar { display: none; position: static; }
    .sidebar.is-open { display: flex; }
    .tiles { grid-template-columns: 1fr; }

    /* administrator pages: the feature list becomes a row of tabs on top */
    /* minmax(0, 1fr): wide tables scroll inside .table-wrap instead of
       widening the page; rows "auto 1fr": the tab row keeps its own height */
    .admin { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
    .admin-nav { border-right: 0; border-bottom: 1px solid var(--line); padding: 8px 16px; }
    .admin-nav h2 { display: none; }
    .admin-nav ul { display: flex; gap: 4px; overflow-x: auto; position: static; }
    .admin-nav a { white-space: nowrap; margin: 0; }
    .admin-main { padding: 16px 16px 40px; }
    .form-grid { grid-template-columns: 1fr; gap: 4px; }
    .form-grid > label, .form-grid > .label { padding-top: 10px; }
    .cat-children { margin-left: 8px; }
    .seating { grid-template-columns: minmax(0, 1fr); }
    .structure { max-height: none; }
}
@media (max-width: 1100px) and (min-width: 761px) {
    .seating { grid-template-columns: minmax(0, 1fr); }
    .structure { max-height: none; }
}

/* ------------------------------------------------------------------ Buying tickets (tickets/*) */
.buy-page { padding-bottom: 110px; }          /* room for the bottom bar */
.buy-head h1 { margin: 0 0 4px; }
.buy-head p { margin: 0 0 16px; }
.disclaimer ol { padding-left: 22px; display: grid; gap: 8px; }
.disclaimer-extra { white-space: normal; }
.disclaimer-actions { margin-top: 18px; }
.level-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.level-card, .zone-card { display: grid; gap: 8px; color: inherit; text-decoration: none; transition: box-shadow .15s, transform .15s; }
.level-card:hover, .zone-card:hover { box-shadow: 0 6px 20px rgba(0, 0, 0, .12); transform: translateY(-2px); }
.level-card h2 { margin: 0; }
.zone-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 12px; }
.buy-stats { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 14px; }
.buy-stats .price-range { font-weight: 700; }
.buy-stats .sold-out { color: #6b7280; font-weight: 600; }
/* Maps: zones in a light tint, seats green (available), grey (not), blue (selected by this buyer) */
.buy-map { width: 100%; height: auto; max-height: 260px; display: block; }
.buy-map-large { max-height: 60vh; }
.buy-map .buy-zone .body { fill: color-mix(in srgb, var(--select) 6%, transparent); stroke: var(--select); stroke-width: 2; }
.buy-map .buy-zone-link { cursor: pointer; }
.buy-map .buy-zone-link:hover .body, .buy-map .buy-zone-link:focus .body { fill: color-mix(in srgb, var(--select) 16%, transparent); stroke-width: 4; }
.buy-map .buy-seat.is-a { fill: #16a34a; }
.buy-map .buy-seat.is-u { fill: #c3c9d1; }
.buy-map .buy-seat.is-m { fill: #2563eb; }
.buy-map .buy-wheel-sign { fill: #fff; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.buy-map .buy-zone-name { font-size: 18px; font-weight: 700; text-anchor: middle; dominant-baseline: central; fill: var(--text);
    paint-order: stroke; stroke: var(--surface); stroke-width: 4px; pointer-events: none; }
.buy-map .shape .body { fill: #e5e7eb; stroke: #9ca3af; }
.buy-map .shape-stage .body { fill: #374151; }
.buy-map .shape-label { font-size: 14px; text-anchor: middle; dominant-baseline: central; fill: #374151; }
.buy-map .shape-stage .shape-label { fill: #fff; font-weight: 700; }
/* Seats of a zone: price colour (legend), grey not available, blue selected; a taken seat blinks red */
.seat-map-wrap { position: relative; overflow: auto; }
.seat-map { width: 100%; height: auto; max-height: 70vh; display: block; user-select: none; }
.hall-map.seat-map .level-bg { fill: var(--surface); }
.hall-map .group .buy-pick { cursor: pointer; }
.hall-map .group .buy-pick.is-a rect { fill: var(--price-colour, #16a34a); }
.hall-map .group .buy-pick.is-u rect { fill: #c3c9d1; }
.hall-map .group .buy-pick.is-u { cursor: default; }
.hall-map .group .buy-pick.is-u .seat-label { fill: #6b7280; }
.hall-map .group .buy-pick.is-m rect { fill: #2563eb; stroke: #1e3a8a; stroke-width: 3; }
.hall-map .group .buy-pick.is-pending { opacity: .6; }
.hall-map .group .buy-pick.is-blinking rect { animation: seat-blink .5s step-end 3; }
@keyframes seat-blink { 0% { fill: #dc2626; } 50% { fill: #c3c9d1; } }
.buy-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 10px; }
.seat-tip { position: absolute; transform: translate(-50%, -110%); background: #111827; color: #fff; padding: 4px 8px; border-radius: 6px;
    font-size: 13px; white-space: nowrap; pointer-events: none; z-index: 2; }
/* General admission: areas with - / + */
.area-cards { display: grid; gap: 12px; }
.area-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.area-card .qty { display: flex; align-items: center; gap: 10px; }
.area-card .qty output { min-width: 2ch; text-align: center; font-weight: 700; font-size: 18px; }
/* The bottom bar */
.buy-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 12px;
    flex-wrap: wrap; padding: 12px max(16px, calc((100vw - 1100px) / 2)); background: var(--surface); border-top: 1px solid var(--line);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, .08); }
.buy-bar-figures { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.buy-bar-actions { display: flex; gap: 10px; }
.buy-bar [data-bar-timer].is-short { color: #dc2626; }
.buy-bar a[aria-disabled="true"] { opacity: .5; }
.buy-dialog { max-width: min(480px, calc(100vw - 32px)); }
.buy-dialog h2 { margin-top: 0; }
/* Check Out: totals, payment options, Cancel / Back to seat selection */
.checkout-table tfoot th { font-size: inherit; text-transform: none; letter-spacing: normal; color: inherit; background: none; font-weight: 600; }
.checkout-table .checkout-total th, .checkout-table .checkout-total td { font-size: 17px; font-weight: 700; border-top: 2px solid var(--line); border-bottom: 0; }
.buy-bar .btn[hidden] { display: none; }
.pay-options { display: grid; gap: 10px; }
.pay-option { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px;
    border: 1px solid var(--line); border-radius: 8px; }
.checkout-actions { margin: 14px 0; }
.checkout-pay h2 + .form-grid { margin-bottom: 18px; }
.checkout-pay input { min-height: 38px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; max-width: 100%; }
.checkout-pay input:focus { outline: none; border-color: #2980b9; box-shadow: 0 0 0 2px rgba(41, 128, 185, .25); }
.checkout-pay input[aria-invalid=true] { border-color: #c0392b; }
.checkout-pay .notice-err { margin-top: 8px; }
.promo-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.promo-row input { width: 14em; text-transform: uppercase; }
.checkout-table .checkout-discount td { color: #1e7e46; }
/* The order's page: its tickets with their QR codes */
.order-tickets { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; margin-bottom: 10px; }
.order-ticket { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 2px dashed var(--line); border-radius: var(--radius); padding: 10px; }
.order-ticket img { width: 150px; height: 150px; image-rendering: pixelated; flex: none; }
.order-tickets ~ .hint { margin: 4px 0 10px; }
.order-ticket-code { font-family: Consolas, monospace; font-size: 12px; color: var(--muted); margin-top: 6px; word-break: break-all; }
.checkout-actions form { margin: 0; }

/* The door's scanning page (views/scan/page, scan.js): big coloured result, the camera, the count */
.scan-page { max-width: 560px; }
.scan-head h1 { margin-bottom: 2px; }
.scan-head p { margin: 2px 0; }
.scan-who { font-weight: 600; }
.scan-count { font-size: 18px; margin: 10px 0; }
.scan-count strong { font-size: 24px; }
.scan-result { border-radius: var(--radius); padding: 18px 18px; margin: 10px 0; border: 3px solid var(--line); background: var(--surface); min-height: 96px; }
.scan-result-title { font-size: 28px; font-weight: 800; line-height: 1.2; }
.scan-result-detail { font-size: 17px; margin-top: 6px; word-break: break-word; }
.scan-result.is-ok { background: #1e9e55; border-color: #1e9e55; color: #fff; }
.scan-result.is-bad { background: #c0392b; border-color: #c0392b; color: #fff; }
.scan-result.is-warn { background: #f5b041; border-color: #f5b041; color: #222; }
.scan-result.is-wait { background: var(--surface); }
.scan-box { position: relative; width: 100%; aspect-ratio: 4 / 3; background: #111; border-radius: var(--radius); overflow: hidden; margin: 10px 0; }
.scan-box video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; inset: 15%; border: 3px solid rgba(255, 255, 255, .85); border-radius: 12px; pointer-events: none; }
.scan-type { display: flex; gap: 8px; margin: 12px 0 18px; }
.scan-type input { flex: 1; min-height: 42px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-family: Consolas, monospace; background: var(--bg); color: var(--text); }
.scan-log { font-size: 14px; color: var(--muted); padding-left: 20px; }
.scan-log li { margin: 3px 0; }
/* A performance's door scanning page (admin/door/index) */
.door-figures { display: flex; gap: 28px; flex-wrap: wrap; margin-bottom: 12px; }
.door-figures div { display: flex; flex-direction: column; }
.door-figures strong { font-size: 30px; line-height: 1.1; }
.door-figures span { color: var(--muted); }
.door-new { margin: 10px 0; }
.door-new input { width: min(100%, 320px); }
.door-code { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.door-code img { width: 220px; height: 220px; image-rendering: pixelated; flex: none; background: #fff; }
.door-link code { word-break: break-all; font-size: 13px; }

/* Ticket information (admin/ticket-info/edit, the order's page) and the company logo */
.info-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; min-height: 34px; }
.info-langs { display: flex; gap: 8px; flex-wrap: wrap; }
.info-suggest[hidden] { display: none; }
.info-suggest { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-left: auto; }
.info-editor { position: relative; background: #fff; color: #222; border-radius: 8px; margin-bottom: 4px; }
.info-img-tools { position: absolute; z-index: 5; display: flex; gap: 4px; flex-wrap: wrap; max-width: 100%; padding: 6px; background: #fff; border: 1px solid #ccc; border-radius: 8px; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }
.info-img-tools[hidden] { display: none; }
.info-img-tools .btn { display: inline-flex; gap: 4px; align-items: center; color: #222; background: #fff; }
.info-img-tools .btn.is-on { background: #fde3d6; border-color: #e67e22; }
.info-img-sep { width: 1px; background: #ddd; margin: 0 4px; }
.info-editor .ql-editor img.is-picked { outline: 3px solid #e67e22; }
.info-editor .ql-editor { min-height: 260px; font-family: Arial, sans-serif; font-size: 14px; line-height: 1.5; }
.info-editor .ql-editor img { max-width: 100%; }
/* Pictures' wrapping (data-wrap, as in Word): the editor and the order's page; emails: inline styles (RichText::render) */
.ql-editor, .rich-text { position: relative; z-index: 0; }
.ql-editor img[data-wrap="square-left"], .rich-text img[data-wrap="square-left"] { float: left; margin: 4px 14px 8px 0; }
.ql-editor img[data-wrap="square-right"], .rich-text img[data-wrap="square-right"] { float: right; margin: 4px 0 8px 14px; }
.ql-editor img[data-wrap="top-bottom"], .rich-text img[data-wrap="top-bottom"] { display: block; margin: 8px 0; }
.ql-editor img[data-wrap="behind"], .rich-text img[data-wrap="behind"] { position: absolute; z-index: -1; }
.rich-text::after { content: ''; display: block; clear: both; }
.rich-text { line-height: 1.5; overflow-wrap: anywhere; }
.rich-text img { max-width: 100%; height: auto; }
.rich-text p { margin: 0 0 8px; }
.rich-text h1, .rich-text h2, .rich-text h3 { text-transform: none; letter-spacing: normal; color: inherit; margin: 12px 0 6px; }
.order-logo { display: block; max-width: 240px; max-height: 120px; margin: 0 0 12px; }
.logo-preview { display: block; max-width: 240px; max-height: 120px; margin: 4px 0 10px; background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 16px 16px; }

/* Reports (admin/reports/*): the figures, the zoomable charts (reports.js), the filter */
.report-filter { display: flex; gap: 10px; align-items: center; margin: 0 0 14px; }
.report-filter select { min-height: 36px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; }
.report-figures { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 0 0 14px; }
.report-figures > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; }
.report-figures strong { font-size: 22px; line-height: 1.2; overflow-wrap: anywhere; }
.report-figures span { color: var(--muted); font-size: 13px; }
.report-chart { position: relative; height: 320px; }
.report-chart-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.report-chart-head h2 { margin: 0; }
.report-switch { display: inline-flex; }
.report-switch .btn { border-radius: 0; }
.report-switch .btn:first-child { border-radius: 8px 0 0 8px; }
.report-switch .btn:last-child { border-radius: 0 8px 8px 0; margin-left: -1px; }
.report-switch .btn.is-on { background: var(--accent, #d35400); border-color: var(--accent, #d35400); color: #fff; }
.report-agents li { margin: 4px 0; }

/* Billing (admin/billing/*) */
.amount-owed { color: #b03a2e; }
@media print { .admin-nav, .site-header, .toolbar, .no-print, header { display: none !important; } .admin-main { margin: 0; } }
