:root {
    color-scheme: light;
    --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --bg: #f6f8fb;
    --bg-elevated: #eef3f8;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --surface-muted: #f1f5f9;
    --surface-inset: #eef2f7;
    --text: #172033;
    --heading: #0b1220;
    --muted: #667085;
    --muted-strong: #475467;
    --line: #e2e8f0;
    --line-strong: #cbd5e1;
    --primary: #0f766e;
    --primary-dark: #115e59;
    --primary-soft: #e6fffb;
    --success: #15803d;
    --success-soft: #ecfdf3;
    --warning: #b45309;
    --warning-soft: #fff7ed;
    --danger: #b42318;
    --danger-soft: #fff1f0;
    --info: #0369a1;
    --info-soft: #eff6ff;
    --locked: #6d28d9;
    --sold: #b42318;
    --reserved: #b45309;
    --disabled: #64748b;
    --focus: rgba(15, 118, 110, .2);
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 10px;
    --control-h: 40px;
    --control-h-sm: 34px;
    --sidebar-w: 292px;
    --topbar-h: 72px;
    --content-max: 1760px;
    --app-gutter: 24px;
    --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow-sm: 0 8px 22px rgba(15, 23, 42, .06);
    --shadow-md: 0 18px 42px rgba(15, 23, 42, .12);
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
}

* { box-sizing: border-box; }

html {
    min-width: 320px;
    background: var(--bg);
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    overflow-x: hidden;
}

body.staff-shell {
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    color: var(--primary);
}

p {
    margin: 0;
    color: var(--muted);
}

h1,
h2,
h3 {
    margin: 0 0 var(--space-1);
    color: var(--heading);
    line-height: 1.18;
    letter-spacing: 0;
}

h1 {
    font-size: 1.75rem;
    font-weight: 750;
}

h2 {
    font-size: 1.08rem;
    font-weight: 720;
}

h3 {
    font-size: .98rem;
    font-weight: 720;
}

code {
    border-radius: var(--radius-xs);
    padding: 2px 5px;
    background: var(--surface-muted);
    color: var(--muted-strong);
    font-size: .9em;
}

.skip-link,
.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;
}

.skip-link:focus {
    z-index: 1000;
    left: var(--space-4);
    top: var(--space-4);
    width: auto;
    height: auto;
    clip: auto;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--heading);
    color: #fff;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
}

.shell-main {
    min-width: 0;
}

.sidebar {
    position: sticky;
    top: 0;
    z-index: 180;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--space-5) var(--space-4);
    border-right: 1px solid var(--line);
    background: #fbfcfe;
}

.brand {
    min-width: 0;
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--heading);
    font-weight: 760;
    line-height: 1.1;
}

.brand > span:last-child {
    min-width: 0;
}

.brand-mark,
.nav-icon,
.settings-section-head > span,
.pos-section-heading > span {
    width: 34px;
    height: 34px;
    min-width: 34px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #99f6e4;
    border-radius: var(--radius);
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: .72rem;
    font-weight: 850;
}

.brand strong {
    display: block;
    color: var(--heading);
    font-size: 1rem;
}

.brand small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: .76rem;
    font-weight: 650;
}

.nav {
    display: flex;
    min-width: 0;
}

.staff-nav {
    flex-direction: column;
    gap: var(--space-4);
    margin-top: var(--space-6);
}

.nav-section {
    display: grid;
    gap: 2px;
}

.nav-section-title {
    display: block;
    margin: 0 10px var(--space-1);
    color: #8792a2;
    font-size: .68rem;
    font-weight: 840;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.nav-section > a,
.nav-menu summary {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 8px 10px;
    color: var(--muted-strong);
    cursor: pointer;
    font-size: .92rem;
    font-weight: 680;
}

.nav-section > a:hover,
.nav-section > a.active,
.nav-menu[open] summary,
.nav-menu[data-current="true"] summary {
    border-color: #b7ebe4;
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.nav-section > a.active .nav-icon,
.nav-menu[data-current="true"] .nav-icon {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.public-nav {
    flex: 0 1 auto;
    justify-content: flex-end;
    gap: 6px;
}

.public-nav a {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 8px 13px;
    color: var(--muted-strong);
    font-weight: 720;
}

.public-nav a:hover,
.public-nav a.active {
    border-color: #b7ebe4;
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.nav-menu {
    position: relative;
}

.nav-menu[open] {
    z-index: 260;
}

.nav-menu summary {
    list-style: none;
    position: relative;
    padding-right: 30px;
}

.nav-menu summary::-webkit-details-marker {
    display: none;
}

.nav-menu summary::after {
    content: "";
    position: absolute;
    right: 13px;
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
}

.nav-menu[open] summary::after {
    transform: rotate(225deg) translateY(-1px);
}

.nav-menu-panel,
.nav-menu div {
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    z-index: 260;
    width: min(920px, calc(100vw - 32px));
    max-height: min(78vh, 720px);
    overflow: auto;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-3);
    padding: var(--space-4);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-md);
}

.nav-menu.nav-menu-wide .nav-menu-panel {
    width: min(920px, calc(100vw - 32px));
}

.sidebar .nav-menu-panel {
    position: static;
    width: auto;
    max-height: none;
    grid-template-columns: 1fr;
    gap: var(--space-2);
    margin-top: var(--space-2);
    padding: 0 0 var(--space-1) 44px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.nav-menu-section {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 1px;
}

.nav-group-label {
    display: block;
    margin: var(--space-2) 10px var(--space-1);
    color: #8792a2;
    font-size: .7rem;
    font-weight: 820;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.nav-menu-section a {
    min-width: 0;
    display: grid;
    gap: 1px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 7px 9px;
}

.nav-menu-section a:hover,
.nav-menu-section a.active {
    border-color: var(--line);
    background: var(--surface);
    color: var(--primary-dark);
}

.nav-menu-section a strong {
    color: inherit;
    font-size: .88rem;
    font-weight: 720;
}

.nav-menu-section a small {
    color: var(--muted);
    font-size: .75rem;
    line-height: 1.25;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 160;
    overflow: visible;
    min-width: 0;
    min-height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(12px);
}

.topbar > * {
    min-width: 0;
}

.public-topbar {
    justify-content: space-between;
    min-height: 68px;
    padding: 14px max(var(--space-4), calc((100vw - 1120px) / 2));
    background: rgba(255, 255, 255, .96);
}

.public-topbar .brand-mark {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.public-topbar .brand small {
    color: var(--primary-dark);
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
    color: var(--muted);
    font-size: .86rem;
    font-weight: 680;
}

.breadcrumbs a,
.breadcrumbs span {
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.breadcrumbs [aria-current="page"] {
    color: var(--heading);
}

.topbar-search {
    flex: 1 1 360px;
    max-width: 520px;
    margin-left: auto;
}

.topbar-search input {
    min-height: 38px;
    border-radius: 999px;
}

.logout-form {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-left: auto;
}

.topbar-search + .logout-form {
    margin-left: 0;
}

.notification-menu {
    position: relative;
    flex: 0 0 auto;
    margin-left: auto;
}

.topbar-search + .notification-menu,
.notification-menu + .logout-form {
    margin-left: 0;
}

.notification-trigger {
    position: relative;
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--muted-strong);
    cursor: pointer;
    font-size: .95rem;
    font-weight: 850;
    list-style: none;
    box-shadow: var(--shadow-xs);
}

.notification-trigger::-webkit-details-marker {
    display: none;
}

.notification-trigger:hover,
.notification-menu[open] .notification-trigger {
    border-color: #99f6e4;
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.notification-trigger strong {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 20px;
    height: 20px;
    display: inline-grid;
    place-items: center;
    border: 2px solid var(--surface);
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: .68rem;
    line-height: 1;
}

.notification-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 220;
    width: min(380px, calc(100vw - 24px));
    max-height: calc(100vh - var(--topbar-h) - 24px);
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-md);
}

.notification-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-4);
    border-bottom: 1px solid var(--line);
}

.notification-panel-header strong {
    color: var(--heading);
    font-size: .95rem;
}

.notification-panel-header a {
    color: var(--primary);
    font-size: .82rem;
    font-weight: 760;
}

.notification-summary {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--line);
    background: var(--surface-soft);
}

.notification-summary span {
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px 8px;
    background: var(--surface);
    color: var(--muted-strong);
    font-size: .74rem;
    font-weight: 720;
}

.notification-list {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.notification-item + .notification-item {
    border-top: 1px solid var(--line);
}

.notification-item a {
    display: grid;
    gap: 3px;
    padding: var(--space-3) var(--space-4);
}

.notification-item a:hover {
    background: var(--surface-soft);
}

.notification-item span {
    color: var(--primary);
    font-size: .72rem;
    font-weight: 820;
    text-transform: uppercase;
}

.notification-item.warning span {
    color: var(--warning);
}

.notification-item.danger span {
    color: var(--danger);
}

.notification-item strong {
    color: var(--heading);
    font-size: .92rem;
}

.notification-item small,
.notification-item em {
    display: block;
    color: var(--muted);
    font-size: .8rem;
    font-style: normal;
    line-height: 1.35;
}

.notification-empty {
    padding: var(--space-4);
    color: var(--muted);
    font-size: .86rem;
}

.notification-inline-list {
    margin-top: var(--space-4);
    border-top: 1px solid var(--line);
    padding-top: var(--space-3);
}

.logout-form span {
    max-width: 180px;
    overflow: hidden;
    color: var(--muted-strong);
    font-size: .86rem;
    font-weight: 680;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-menu-button {
    display: none;
}

.menu-bars {
    position: relative;
    width: 16px;
    height: 12px;
    display: inline-block;
}

.menu-bars::before,
.menu-bars::after,
.menu-bars {
    border-top: 2px solid currentColor;
}

.menu-bars::before,
.menu-bars::after {
    content: "";
    position: absolute;
    left: 0;
    width: 16px;
}

.menu-bars::before {
    top: 3px;
}

.menu-bars::after {
    top: 8px;
}

.page {
    width: min(var(--content-max), calc(100% - 32px));
    min-width: 0;
    margin: var(--space-6) auto 56px;
}

.public-page {
    width: min(1360px, calc(100% - 32px));
    margin-top: 28px;
    margin-bottom: 72px;
}

.page-header {
    margin-bottom: var(--space-5);
}

.page-header.row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-4);
    width: 100%;
    margin-right: 0;
    margin-left: 0;
}

.page-header.row > * {
    width: auto;
    max-width: 100%;
    min-width: 0;
    flex-shrink: 1;
    padding-right: 0;
    padding-left: 0;
}

.page-header.row > :first-child {
    flex: 1 1 auto;
}

.page-header.row > .row-actions,
.page-header.row > .settings-status {
    flex: 0 1 auto;
}

.page-header p {
    max-width: 780px;
}

.panel,
.auth-panel,
.scanner-panel,
.stat,
.quick-action,
.event-row,
.event-card,
.calendar-cell,
.calendar-day,
.confirmation-note,
.install-check,
.settings-diagnostics-item,
.settings-category-item,
.workstream-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}

.panel,
.auth-panel,
.scanner-panel {
    width: 100%;
    min-width: 0;
    padding: var(--space-5);
}

.panel.narrow {
    max-width: 640px;
}

.panel + .panel,
.panel-grid + .panel,
.stats-grid + .panel,
.quick-actions + .stats-grid,
.table-wrap + .table-wrap,
.form + .table-wrap {
    margin-top: var(--space-4);
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--line);
}

.panel-header > * {
    min-width: 0;
}

.panel-header h2 {
    margin: 0;
}

.panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
    gap: var(--space-4);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-5);
}

.stat {
    min-height: 104px;
    display: grid;
    align-content: space-between;
    gap: var(--space-3);
    padding: var(--space-4);
}

a.stat:hover {
    border-color: #99f6e4;
    box-shadow: var(--shadow-sm);
}

.stat span,
.stat small {
    color: var(--muted);
    font-size: .76rem;
    font-weight: 780;
}

.stat span {
    text-transform: uppercase;
}

.stat strong {
    color: var(--heading);
    font-size: 1.55rem;
    font-weight: 760;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-5);
}

.quick-action {
    min-height: 104px;
    display: grid;
    align-content: center;
    gap: var(--space-1);
    padding: var(--space-5);
    transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease;
}

.quick-action:hover,
.quick-action:focus-visible {
    transform: translateY(-1px);
    border-color: #99f6e4;
    box-shadow: var(--shadow-sm);
}

.quick-action.primary {
    border-color: #99f6e4;
    background: linear-gradient(180deg, #f0fdfa, #ffffff);
}

.quick-action strong {
    color: var(--heading);
    font-size: 1rem;
}

.quick-action span {
    color: var(--muted);
    font-size: .88rem;
}

.dashboard-work-grid,
.detail-layout,
.record-layout {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
    gap: var(--space-4);
    align-items: start;
    margin-bottom: var(--space-5);
}

.workstream-grid {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-4);
}

.workstream-card {
    display: grid;
    align-content: start;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--surface-soft);
}

.workstream-card > span {
    color: var(--muted);
    font-size: .72rem;
    font-weight: 820;
    text-transform: uppercase;
}

.workstream-card > strong {
    color: var(--heading);
    font-size: 1.6rem;
    line-height: 1;
}

.metric-stack,
.form,
.scanner-form,
.scanner-panel,
.install-form,
.settings-form,
.settings-main,
.settings-side,
.settings-card,
.settings-section,
.ticket-attendee-fields,
.reservation-customer,
.stack,
.cart,
.seat-details,
.ticket-template-preview-panel,
.template-editor,
.template-element-control,
.ticket-box-control,
.custom-element-control,
.sector-editor,
.row-editor-grid,
.hall-seat-editor-layout,
.seat-editor-panel,
.seat-bulk-form,
.renumber-form,
.compact-renumber-form,
.add-sector-form,
.sector-edit-form,
.add-row-form,
.add-seats-form {
    display: grid;
    gap: var(--space-4);
}

.plain-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.plain-list li {
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
}

.plain-list li:last-child {
    border-bottom: 0;
}

.summary-list,
.details-list {
    display: grid;
    grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
    gap: 10px 16px;
    margin: 0;
}

.summary-list dt,
.details-list dt {
    color: var(--muted);
    font-size: .75rem;
    font-weight: 780;
    text-transform: uppercase;
}

.summary-list dd,
.details-list dd {
    margin: 0;
    color: var(--heading);
}

.muted {
    color: var(--muted);
    font-size: .88rem;
}

label,
fieldset {
    display: grid;
    gap: 6px;
    color: var(--muted-strong);
    font-weight: 680;
}

.field-label {
    color: var(--muted-strong);
    font-weight: 680;
}

.required-mark {
    color: var(--danger);
    font-weight: 850;
}

fieldset {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: var(--space-4);
    background: var(--surface-soft);
}

legend {
    width: auto;
    margin-bottom: 0;
    padding: 0 6px;
    color: var(--muted-strong);
    font-size: .86rem;
    font-weight: 760;
}

input,
select,
textarea {
    width: 100%;
    min-height: var(--control-h);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 9px 11px;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-weight: 520;
}

textarea {
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: #98a2b3;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible,
summary:focus-visible {
    border-color: var(--primary);
    outline: 3px solid var(--focus);
    outline-offset: 1px;
}

input:disabled,
select:disabled,
textarea:disabled,
.button:disabled,
.button.disabled,
[aria-disabled="true"] {
    opacity: .58;
    cursor: not-allowed;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
}

.form-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid .wide,
.wide {
    grid-column: 1 / -1;
}

.toolbar-form,
.filters,
.reports-toolbar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    align-items: end;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    padding: var(--space-4);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
}

.reports-toolbar {
    grid-template-columns: repeat(2, minmax(180px, 240px)) auto;
}

.reservations-filter {
    grid-template-columns: minmax(220px, 1fr) minmax(150px, 220px) minmax(140px, 200px) auto;
}

.button {
    min-height: var(--control-h);
    max-width: 100%;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 8px 13px;
    background: var(--surface);
    color: var(--muted-strong);
    cursor: pointer;
    font: inherit;
    font-weight: 720;
    line-height: 1.1;
    text-align: center;
    white-space: normal;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.button:hover {
    border-color: #99f6e4;
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.button.primary {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.button.primary:hover {
    border-color: var(--primary-dark);
    background: var(--primary-dark);
    color: #fff;
}

.button.ghost {
    background: #fff;
}

.button.tertiary {
    border-color: transparent;
    background: transparent;
    color: var(--muted);
}

.button.tertiary:hover {
    background: var(--surface-muted);
    color: var(--heading);
}

.button.danger,
.button.destructive {
    border-color: #fecaca;
    background: #fff;
    color: var(--danger);
}

.button.danger:hover,
.button.destructive:hover {
    border-color: #fda29b;
    background: var(--danger-soft);
}

.button.full {
    width: 100%;
}

.icon-button {
    width: var(--control-h);
    min-width: var(--control-h);
    padding-inline: 0;
}

.button-group,
.row-actions,
.action-row,
.scanner-actions,
.camera-panel,
.validation-ticket-actions,
.template-element-picker,
.template-add-toolbar,
.ticket-size-presets,
.preview-toolbar,
.template-active-bar,
.asset-badges,
.legend,
.pos-flow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
}

.row-actions,
.action-row {
    justify-content: flex-end;
}

.table-wrap .row-actions {
    min-width: min(320px, 100%);
    justify-content: flex-start;
}

.row-actions form,
.action-row form {
    min-width: 0;
    margin: 0;
}

.ticket-row-operation {
    width: min(100%, 360px);
}

.ticket-row-operation summary {
    min-height: var(--control-h);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 8px 13px;
    background: var(--surface);
    color: var(--muted-strong);
    cursor: pointer;
    font-weight: 720;
    line-height: 1.1;
}

.ticket-row-operation form {
    display: grid;
    gap: var(--space-3);
    margin-top: var(--space-2);
    padding: var(--space-3);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
}

.alert {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: var(--space-4);
    background: var(--surface);
    color: var(--text);
}

.alert.success {
    border-color: #bbf7d0;
    background: var(--success-soft);
    color: #166534;
}

.alert.error {
    border-color: #fecaca;
    background: var(--danger-soft);
    color: var(--danger);
}

.badge {
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px 9px;
    background: var(--surface-muted);
    color: var(--muted-strong);
    font-size: .75rem;
    font-weight: 760;
    line-height: 1.1;
    white-space: normal;
}

.badge.ok,
.badge.success {
    border-color: #bbf7d0;
    background: var(--success-soft);
    color: #166534;
}

.badge.warn,
.badge.warning {
    border-color: #fed7aa;
    background: var(--warning-soft);
    color: #9a3412;
}

.badge.muted {
    border-color: var(--line);
    background: var(--surface-muted);
    color: var(--muted-strong);
}

.badge.error,
.badge.danger {
    border-color: #fecaca;
    background: var(--danger-soft);
    color: var(--danger);
}

.table-wrap {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

table {
    width: 100%;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th,
td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    color: var(--muted-strong);
    text-align: left;
    vertical-align: top;
    white-space: normal;
    overflow-wrap: anywhere;
}

th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: .72rem;
    font-weight: 820;
    letter-spacing: .06em;
    text-transform: uppercase;
}

tbody tr:hover td {
    background: #fbfefd;
}

.table-wrap th:last-child,
.table-wrap td:last-child {
    position: sticky;
    right: 0;
    z-index: 2;
    border-left: 1px solid var(--line);
    background: var(--surface);
}

.table-wrap th:last-child {
    z-index: 3;
    background: var(--surface-soft);
}

.table-wrap tbody tr:hover td:last-child {
    background: #fbfefd;
}

tbody tr:last-child td {
    border-bottom: 0;
}

td strong {
    color: var(--heading);
}

.table-wrap td[colspan],
td[colspan] {
    position: static;
    height: 96px;
    color: var(--muted);
    text-align: center;
    white-space: normal;
}

.dense-table th,
.dense-table td {
    padding: 9px 10px;
    font-size: .88rem;
}

.empty-state,
.loading-state,
.error-state,
.no-results-state,
.no-permissions-state {
    min-height: 160px;
    display: grid;
    place-items: center;
    gap: var(--space-2);
    padding: var(--space-8);
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface-soft);
    text-align: center;
}

.empty-state h2,
.loading-state h2,
.error-state h2,
.no-results-state h2,
.no-permissions-state h2 {
    font-size: 1.08rem;
}

.skeleton {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
}

.skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent);
    animation: skeleton-loading 1.4s infinite;
}

@keyframes skeleton-loading {
    100% { transform: translateX(100%); }
}

.code-block {
    max-height: 520px;
    overflow: auto;
    margin: 0;
    padding: var(--space-4);
    border: 1px solid #1f2937;
    border-radius: var(--radius);
    background: #111827;
    color: #e5e7eb;
    font-size: .86rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.auth-shell,
.scanner-shell {
    min-height: calc(100vh - 160px);
    display: grid;
    place-items: center;
}

.auth-panel {
    width: min(440px, 100%);
    display: grid;
    gap: var(--space-4);
}

.auth-divider {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: var(--space-3);
    color: var(--muted);
    font-size: .78rem;
    font-weight: 760;
    text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    height: 1px;
    background: var(--line);
}

.scanner-panel {
    width: min(820px, 100%);
}

.checkbox,
.checkbox-row,
.inline-check {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 650;
}

.checkbox input,
.checkbox-row input,
.inline-check input {
    width: auto;
    min-height: auto;
}

.public-shell {
    background: #f7fafc;
}

.public-shell .panel {
    border-color: #dde6ef;
    box-shadow: var(--shadow-xs);
}

.public-shell .panel-header {
    border-color: #e7edf4;
}

.public-shell .page-header:not(.public-hero) {
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--line);
}

.public-hero,
.public-home-hero {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(230px, 300px);
    align-items: stretch;
    gap: var(--space-5);
    margin-bottom: var(--space-5);
    padding: var(--space-8);
    border: 1px solid #dbe6ee;
    border-radius: var(--radius);
    background: #fff;
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.public-hero h1,
.public-home-hero h1 {
    max-width: 720px;
    color: var(--heading);
    font-size: 2rem;
}

.public-hero p,
.public-home-hero p {
    max-width: 680px;
    color: var(--muted-strong);
    font-size: 1rem;
}

.public-hero-content,
.public-hero > div:first-child {
    min-width: 0;
    display: grid;
    align-content: center;
    gap: var(--space-3);
}

.hero-kicker {
    width: fit-content;
    border: 1px solid #b7ebe4;
    border-radius: 999px;
    padding: 4px 9px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: .74rem;
    font-weight: 820;
    text-transform: uppercase;
}

.hero-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-2);
}

.hero-metrics span {
    min-height: 58px;
    min-width: 132px;
    display: grid;
    align-content: center;
    gap: 2px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 8px 12px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: .78rem;
    font-weight: 720;
}

.hero-metrics strong {
    display: block;
    color: var(--heading);
    font-size: 1.18rem;
    font-weight: 780;
    line-height: 1.1;
}

.public-hero-aside {
    min-width: 0;
    display: grid;
    align-content: space-between;
    gap: var(--space-4);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: var(--space-4);
    background: var(--surface-soft);
}

.public-hero-aside strong {
    color: var(--heading);
    font-size: 1.1rem;
}

.public-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
    gap: var(--space-3);
    align-items: stretch;
    margin-bottom: var(--space-4);
}

.month-switcher,
.public-filter {
    min-width: 0;
    align-items: end;
    gap: var(--space-3);
    padding: var(--space-4);
    border: 1px solid #dbe6ee;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}

.month-switcher {
    display: grid;
    grid-template-columns: auto minmax(120px, 1fr) auto;
    align-items: center;
}

.public-filter {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
}

.month-switcher strong {
    min-width: 0;
    color: var(--heading);
    text-align: center;
}

.public-calendar-month {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 7px;
    margin-bottom: var(--space-6);
    padding: var(--space-3);
    border: 1px solid #dbe6ee;
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow-xs);
}

.calendar-weekday {
    padding: 2px 0 var(--space-1);
    color: var(--muted);
    font-size: .72rem;
    font-weight: 820;
    text-align: center;
}

.calendar-cell {
    min-height: 76px;
    display: grid;
    align-content: start;
    gap: var(--space-1);
    border-color: #e7edf4;
    padding: var(--space-3);
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}

.calendar-cell:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-xs);
}

.calendar-cell.empty {
    border-style: dashed;
    background: var(--surface-soft);
}

.calendar-cell.has-events {
    border-color: #99dcd3;
    background: #f2fbf9;
}

.calendar-cell strong {
    color: var(--heading);
}

.calendar-cell span {
    color: var(--primary-dark);
    font-size: .75rem;
    font-weight: 780;
}

.event-list-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-4);
    margin: var(--space-6) 0 var(--space-3);
}

.event-list-heading p {
    max-width: 720px;
}

.event-list {
    display: grid;
    gap: var(--space-3);
}

.event-row,
.event-card {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr) minmax(170px, auto);
    gap: var(--space-4);
    align-items: center;
    padding: var(--space-4);
    transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease;
}

.event-card:hover {
    transform: translateY(-1px);
    border-color: #b7ebe4;
    box-shadow: var(--shadow-sm);
}

.event-card.has-poster {
    grid-template-columns: 76px 118px minmax(0, 1fr) minmax(170px, auto);
}

.event-date {
    min-height: 66px;
    display: grid;
    place-items: center;
    align-content: center;
    border: 1px solid #b7ebe4;
    border-radius: var(--radius);
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.event-date strong {
    font-size: 1.18rem;
    line-height: 1;
}

.event-date span {
    color: var(--primary-dark);
    font-size: .8rem;
    font-weight: 760;
}

.event-main {
    min-width: 0;
}

.event-main h2 {
    margin: 0;
    font-size: 1.08rem;
}

.event-main p {
    max-width: 760px;
    margin-top: var(--space-1);
}

.event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: var(--space-2);
}

.event-meta span {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px 8px;
    background: var(--surface-soft);
    color: var(--muted-strong);
    font-size: .78rem;
    font-weight: 720;
}

.event-action {
    min-width: 160px;
    display: grid;
    justify-items: stretch;
    gap: var(--space-2);
}

.event-action .badge {
    justify-self: end;
}

.event-action .button {
    width: 100%;
}

.public-event-poster {
    width: 118px;
    height: 86px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    object-fit: cover;
    background: var(--surface-soft);
}

.public-event-detail,
.event-profile,
.reservation-event-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: var(--space-5);
    align-items: stretch;
    margin-bottom: var(--space-5);
}

.public-event-detail:not(.has-poster) {
    grid-template-columns: 1fr;
}

.public-event-detail:not(.has-poster) .public-event-copy {
    min-height: 240px;
}

.public-event-copy {
    min-width: 0;
    min-height: 300px;
    display: grid;
    align-content: center;
    gap: var(--space-3);
    border: 1px solid #dbe6ee;
    border-radius: var(--radius);
    padding: var(--space-8);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}

.public-event-copy .button {
    justify-self: start;
}

.public-event-copy h1 {
    font-size: 2rem;
}

.public-event-detail-poster,
.reservation-event-poster,
.event-poster-preview,
.event-poster-frame img {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    object-fit: cover;
    background: var(--surface);
}

.public-event-detail-poster {
    height: 100%;
    min-height: 300px;
}

.reservation-event-poster {
    max-height: 360px;
    object-fit: contain;
}

.event-poster-frame {
    min-height: 210px;
    display: grid;
    place-items: center;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface-soft);
}

.public-event-description p {
    color: var(--text);
}

.confirmation-panel {
    width: min(760px, 100%);
    margin: 12px auto 0;
    display: grid;
    gap: var(--space-4);
    padding: var(--space-6);
}

.confirmation-panel > .badge {
    justify-self: start;
}

.confirmation-panel h1 {
    font-size: 1.78rem;
}

.confirmation-panel .summary-list {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: var(--space-4);
    background: #fff;
}

.confirmation-note {
    padding: var(--space-4);
    border: 1px solid #dbe6ee;
    background: var(--surface-soft);
}

.public-form-card {
    width: min(760px, 100%);
    margin-inline: auto;
}

.public-booking-layout {
    display: grid;
    grid-template-columns: minmax(280px, 330px) minmax(0, 1fr);
    gap: var(--space-4);
    align-items: start;
}

.booking-info-panel,
.booking-workspace {
    min-width: 0;
    display: grid;
    gap: var(--space-4);
}

.booking-info-panel {
    position: sticky;
    top: calc(var(--topbar-h) + var(--space-4));
}

.booking-info-card {
    display: grid;
    gap: var(--space-3);
}

.booking-info-card .summary-list {
    grid-template-columns: minmax(96px, 120px) minmax(0, 1fr);
}

.booking-info-panel .reservation-event-poster {
    width: 100%;
    max-height: 360px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    object-fit: cover;
    background: var(--surface);
}

.booking-workspace .public-form-card {
    width: 100%;
    margin-inline: 0;
}

.reservation-layout {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: var(--space-4);
    align-items: start;
    margin-top: 0;
}

.reservation-layout.is-seat-step {
    grid-template-columns: 1fr;
}

.reservation-layout.is-details-step {
    grid-template-columns: minmax(280px, 760px);
    justify-content: center;
}

.reservation-layout [hidden] {
    display: none !important;
}

.reservation-steps {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-2);
}

.reservation-steps span,
.reservation-step {
    min-height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--muted);
    font-weight: 780;
}

.reservation-steps span.is-active,
.reservation-step.active,
.reservation-step[aria-current="step"] {
    border-color: #99dcd3;
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.seat-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-3);
}

.seat-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
    color: var(--muted-strong);
    font-size: .84rem;
    font-weight: 720;
}

.reservation-status {
    min-height: 20px;
    margin-bottom: var(--space-2);
    color: var(--muted-strong);
    font-weight: 700;
}

.reservation-status.success {
    color: var(--success);
}

.reservation-status.error {
    color: var(--danger);
}

.seat-map-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: var(--space-3);
    padding: var(--space-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
}

.seat-map-toolbar .icon-button {
    width: var(--control-h-sm);
    min-height: var(--control-h-sm);
    padding: 0;
}

.seat-map-viewport {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 460px;
    overflow: auto;
    overscroll-behavior-x: contain;
    touch-action: none;
    border: 1px solid #dbe6ee;
    border-radius: var(--radius);
    background:
        linear-gradient(90deg, rgba(203, 213, 225, .35) 1px, transparent 1px),
        linear-gradient(rgba(203, 213, 225, .35) 1px, transparent 1px),
        #fbfdff;
    background-size: 24px 24px;
    cursor: grab;
}

.seat-map-viewport.dragging {
    cursor: grabbing;
}

.seat-map-viewport > [data-seat-map-target] {
    width: max-content;
    min-width: 100%;
}

.reservation-step-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-top: var(--space-4);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: var(--space-3);
    background: var(--surface-soft);
}

.reservation-step-actions span {
    display: block;
    color: var(--muted);
    font-size: .74rem;
    font-weight: 820;
    text-transform: uppercase;
}

.reservation-step-actions strong,
.reservation-sidebar strong {
    color: var(--heading);
}

.reservation-sidebar {
    display: grid;
    gap: var(--space-4);
}

.reservation-sidebar > section {
    display: grid;
    gap: var(--space-3);
}

.reservation-sidebar .form {
    gap: var(--space-3);
}

.ticket-attendee-section {
    display: grid;
    gap: var(--space-3);
    border-top: 1px solid var(--line);
    padding-top: var(--space-3);
}

.ticket-attendee-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.ticket-attendee-header h2 {
    margin: 0;
}

.sectorized-seat-map {
    display: grid;
    gap: 18px;
    transform-origin: top left;
}

.seat-sector {
    min-width: max-content;
    display: grid;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.seat-sector-title,
.pos-row-label,
.public-row-label {
    color: var(--muted-strong);
    font-size: .82rem;
    font-weight: 780;
}

.seat-sector-grid {
    display: grid;
    grid-template-columns: repeat(var(--seat-columns, 10), 30px);
    gap: 6px;
    align-items: center;
}

.pos-layout .seat-sector-grid,
.public-seat-map .seat-sector-grid {
    grid-template-columns: 34px repeat(var(--seat-columns, 10), 32px);
}

.seat,
.public-seat {
    position: relative;
    width: 30px;
    min-width: 30px;
    height: 30px;
    min-height: 30px;
    display: grid;
    place-items: center;
    border: 1px solid currentColor;
    border-radius: 999px;
    background: #fff;
    color: var(--success);
    cursor: pointer;
    font-size: 0;
}

.public-seat {
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
}

.public-seat input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.pos-layout .seat::before,
.public-seat-map .public-seat::before {
    content: "";
    position: absolute;
    inset: 5px;
    border-radius: 999px;
    background: currentColor;
}

.pos-layout .seat::after,
.pos-layout .seat.selected::after {
    content: attr(data-seat-number);
    position: relative;
    z-index: 1;
    color: #fff;
    font-size: 10px;
    font-weight: 850;
}

.public-seat > span {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    text-align: center;
    pointer-events: none;
    text-shadow: 0 1px 1px rgba(15, 23, 42, .28);
}

.public-seat > small:not(.seat-meta) {
    display: none;
}

.seat.available,
.public-seat.available { color: var(--success); }
.seat.selected,
.public-seat.selected { color: var(--primary); background: #ccfbf1; }
.seat.locked,
.public-seat.locked { color: var(--locked); background: #ede9fe; cursor: not-allowed; }
.seat.reserved,
.public-seat.reserved { color: var(--reserved); background: #ffedd5; cursor: not-allowed; }
.seat.sold,
.public-seat.sold { color: var(--sold); background: #fee2e2; cursor: not-allowed; }
.seat.disabled,
.public-seat.disabled,
.public-seat.unavailable { color: var(--disabled); background: #e2e8f0; cursor: not-allowed; }

.public-seat-map .public-seat.unavailable {
    color: var(--disabled);
}

.seat.disabled::after {
    content: "X";
    color: currentColor;
    font-size: .68rem;
    font-weight: 850;
}

.public-seat.disabled::after,
.public-seat.unavailable::after {
    content: none;
}

.seat.accessible,
.public-seat.accessible {
    box-shadow: 0 0 0 3px #bae6fd;
}

.seat.special,
.public-seat.special {
    border-style: dashed;
}

.pos-layout .seat[aria-disabled="true"],
.seat:disabled,
.public-seat input:disabled {
    cursor: not-allowed;
}

.seat-meta {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 2px;
    color: var(--muted-strong);
    font-size: 9px;
    font-weight: 780;
    white-space: nowrap;
}

.admin-seat-map .seat.selected {
    outline: 3px solid rgba(15, 118, 110, .28);
}

.admin-seat-map .seat.bulk-selected {
    box-shadow: 0 0 0 4px rgba(180, 83, 9, .25);
}

.stage {
    min-height: 34px;
    display: grid;
    place-items: center;
    margin: var(--space-2) 0 var(--space-4);
    border-radius: var(--radius);
    background: var(--heading);
    color: #fff;
    font-size: .76rem;
    font-weight: 820;
    letter-spacing: .08em;
}

.pos-page-header {
    display: none;
}

.pos-layout,
.pos-workspace {
    display: grid;
    grid-template-columns: minmax(250px, 300px) minmax(0, 1fr) minmax(310px, 380px);
    grid-template-areas:
        "setup plan tickets"
        "actions plan tickets";
    gap: var(--space-4);
    align-items: start;
}

.pos-setup-panel { grid-area: setup; }
.pos-seat-panel { grid-area: plan; }
.pos-ticket-panel { grid-area: tickets; }
.pos-actions-panel { grid-area: actions; }

.pos-setup-panel,
.pos-ticket-panel,
.pos-actions-panel,
.settings-side,
.seat-editor-panel,
.reservation-sidebar {
    position: sticky;
    top: calc(var(--topbar-h) + var(--space-4));
    max-height: calc(100vh - var(--topbar-h) - 40px);
    overflow: auto;
}

.pos-setup-panel,
.pos-actions-panel,
.pos-ticket-panel {
    align-self: start;
}

.pos-ticket-panel,
.pos-actions-panel,
.pos-finalization {
    display: grid;
    gap: var(--space-4);
}

.pos-seat-panel {
    min-width: 0;
}

@media (min-width: 1580px) {
    .pos-layout,
    .pos-workspace {
        grid-template-columns: minmax(240px, 280px) minmax(0, 1fr) minmax(320px, 380px) minmax(250px, 300px);
        grid-template-areas: "setup plan tickets actions";
    }
}

.pos-ticket-panel .cart {
    gap: var(--space-3);
}

.pos-occurrence-filters {
    display: grid;
    gap: var(--space-3);
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 720;
}

.availability-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
    color: var(--muted-strong);
    font-size: .84rem;
}

.legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.seat-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: currentColor;
}

.seat-dot.available { color: var(--success); }
.seat-dot.selected { color: var(--primary); }
.seat-dot.locked { color: var(--locked); }
.seat-dot.reserved { color: var(--reserved); }
.seat-dot.sold { color: var(--sold); }
.seat-dot.disabled { color: var(--disabled); }

.cart-items {
    display: grid;
    gap: var(--space-2);
    max-height: min(42vh, 420px);
    overflow: auto;
}

.cart-item {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-2);
    align-items: stretch;
    padding: var(--space-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
}

.cart-item-main {
    display: flex;
    justify-content: space-between;
    gap: var(--space-2);
    align-items: flex-start;
}

.cart-item-meta {
    display: grid;
    gap: 2px;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 720;
    text-align: right;
}

.cart-remove {
    min-height: var(--control-h-sm);
}

.pos-cart-kpis {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
}

.pos-cart-kpis span {
    display: grid;
    gap: 2px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: var(--space-3);
    background: var(--surface-soft);
}

.pos-cart-kpis strong {
    color: var(--heading);
    font-size: 1.1rem;
    line-height: 1.1;
}

.pos-cart-kpis small,
.pos-cart-state {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 760;
}

.pos-cart-state {
    margin: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: var(--space-2) var(--space-3);
    background: #fff;
}

.pos-cart-actions {
    display: grid;
    gap: var(--space-2);
    margin-top: var(--space-2);
    padding-top: var(--space-2);
    border-top: 1px solid var(--line);
}

.pos-section-heading {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: var(--space-3);
    align-items: start;
}

.pos-section-heading > span,
.settings-section-head > span {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.pos-plan-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-3);
    align-items: start;
    margin-bottom: var(--space-3);
}

.pos-flow {
    justify-content: flex-end;
}

.pos-flow span {
    min-height: 28px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #99f6e4;
    border-radius: 999px;
    padding: 4px 9px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: .74rem;
    font-weight: 780;
}

.seat-details,
.plan-edit-note,
.seat-editor-selected {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: var(--space-3);
    background: var(--surface-soft);
}

.seat-detail-grid {
    display: grid;
    gap: var(--space-2);
}

.seat-detail-row,
.sale-result-detail {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
}

.seat-detail-row span,
.sale-result-detail span {
    color: var(--muted);
}

.seat-detail-row strong,
.sale-result-detail strong {
    color: var(--heading);
}

.seat-detail-hint {
    color: var(--muted);
    font-size: .84rem;
}

.seat-status-badge {
    display: inline-flex;
    width: fit-content;
    border-radius: 999px;
    padding: 3px 8px;
    background: var(--surface-muted);
    font-size: .75rem;
    font-weight: 780;
}

.seat-status-badge.available { color: var(--success); }
.seat-status-badge.selected { color: var(--primary); }
.seat-status-badge.locked { color: var(--locked); }
.seat-status-badge.reserved { color: var(--reserved); }
.seat-status-badge.sold { color: var(--sold); }
.seat-status-badge.disabled { color: var(--disabled); }

.sale-result-details,
.sale-result-actions,
.control-summary,
.control-counts,
.settings-diagnostics-list,
.settings-category-list {
    display: grid;
    gap: var(--space-3);
}

.control-counts {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.control-count {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: var(--space-3);
    background: var(--surface);
}

.control-history-table td {
    white-space: normal;
}

.validation-result {
    display: grid;
    gap: var(--space-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: var(--space-4);
    background: var(--surface-soft);
}

.validation-result .result-symbol {
    font-size: 2rem;
    line-height: 1;
}

.validation-result.valid { border-color: #16a34a; background: var(--success-soft); color: #166534; }
.validation-result.already_used { border-color: #f59e0b; background: var(--warning-soft); color: #92400e; }
.validation-result.cancelled,
.validation-result.not_found,
.validation-result.error { border-color: #ef4444; background: var(--danger-soft); color: var(--danger); }
.validation-result.other_occurrence { border-color: #3b82f6; background: var(--info-soft); color: var(--info); }

.scanner-actions .button[aria-disabled="true"] {
    pointer-events: none;
}

.nearest-occurrence-button,
.history-filter-field {
    margin-top: var(--space-2);
}

.settings-header {
    align-items: flex-end;
}

.settings-status {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    min-width: 0;
    justify-content: flex-end;
}

.settings-layout {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
    gap: var(--space-4);
    align-items: start;
}

.settings-section {
    padding-bottom: var(--space-5);
    border-bottom: 1px solid var(--line);
}

.settings-section:last-of-type {
    border-bottom: 0;
}

.settings-card-inline {
    display: grid;
    gap: var(--space-4);
    padding: var(--space-4);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
}

.settings-section-head {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: var(--space-3);
    align-items: start;
}

.settings-section-head.compact {
    grid-template-columns: 30px minmax(0, 1fr);
}

.settings-section-head.compact > span {
    width: 30px;
    height: 30px;
    min-width: 30px;
    font-size: .78rem;
}

.settings-toggle {
    width: fit-content;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid #bbf7d0;
    border-radius: var(--radius);
    background: var(--success-soft);
}

.settings-copy-row,
.settings-category-form,
.settings-category-item,
.settings-diagnostics-item {
    display: grid;
    gap: var(--space-2);
    align-items: center;
}

.settings-copy-row {
    grid-template-columns: minmax(0, 1fr) auto;
}

.settings-link-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: var(--space-3);
    background: var(--surface-soft);
}

.settings-link-card strong,
.settings-link-card span {
    display: block;
}

.settings-link-card span {
    color: var(--muted);
    font-size: .84rem;
}

.email-template-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
}

.email-template-grid .wide {
    grid-column: 1 / -1;
}

.email-template-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.email-template-tags code {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 4px 7px;
    background: var(--surface-soft);
    color: var(--primary-dark);
    font-size: .78rem;
}

.settings-category-form {
    grid-template-columns: minmax(0, 1fr) auto;
}

.settings-category-item {
    grid-template-columns: minmax(0, 1fr) auto auto;
    padding: var(--space-3);
    background: var(--surface-soft);
}

.settings-category-item span,
.settings-diagnostics-item span {
    display: block;
    color: var(--muted);
    font-size: .84rem;
}

.settings-diagnostics-item {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    padding: var(--space-3);
}

.settings-diagnostics-item.ok {
    border-color: #bbf7d0;
    background: var(--success-soft);
}

.settings-diagnostics-item.error {
    border-color: #fecaca;
    background: var(--danger-soft);
}

.settings-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.hall-seat-editor-layout {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
}

.ticket-template-layout,
.ticket-card-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
    gap: var(--space-4);
    align-items: start;
}

.ticket-template-studio {
    gap: 0;
}

.ticket-studio-bar {
    position: sticky;
    top: var(--topbar-h);
    z-index: 70;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin: calc(var(--space-4) * -1) calc(var(--space-4) * -1) var(--space-4);
    padding: var(--space-4);
    border-bottom: 1px solid var(--line);
    background: rgba(246, 248, 251, .94);
    backdrop-filter: blur(12px);
}

.eyebrow {
    display: block;
    margin-bottom: 4px;
    color: var(--primary-dark);
    font-size: .72rem;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.ticket-studio-grid {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(420px, 1fr) minmax(300px, 360px);
    gap: var(--space-4);
    align-items: start;
}

.ticket-studio-panel,
.ticket-studio-stage {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}

.ticket-studio-panel {
    display: grid;
    gap: var(--space-4);
    padding: var(--space-4);
}

.ticket-studio-setup,
.ticket-studio-inspector {
    position: sticky;
    top: 96px;
    max-height: calc(100vh - 112px);
    overflow: auto;
}

.ticket-studio-stage {
    overflow: hidden;
}

.studio-panel-head,
.preview-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
}

.studio-panel-head > span {
    width: 30px;
    height: 30px;
    min-width: 30px;
    display: inline-grid;
    place-items: center;
    border-radius: var(--radius);
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 850;
}

.ticket-config-grid,
.ticket-asset-grid {
    display: grid;
    gap: var(--space-3);
}

.ticket-visibility-grid {
    grid-template-columns: 1fr;
}

.studio-subsection {
    display: grid;
    gap: var(--space-3);
}

.studio-subsection h3 {
    color: var(--heading);
    font-size: .9rem;
}

.asset-field {
    display: grid;
    gap: 6px;
    padding: var(--space-3);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
}

.preview-panel-header {
    padding: var(--space-4);
    border-bottom: 1px solid var(--line);
    background: #fff;
}

.preview-toolbar output {
    min-width: 52px;
    color: var(--muted-strong);
    font-weight: 760;
    text-align: center;
}

.ticket-preview-scroll {
    overflow: auto;
    min-height: calc(100vh - 214px);
    max-height: calc(100vh - 214px);
    border: 0;
    border-radius: 0;
    background:
        linear-gradient(90deg, rgba(203, 213, 225, .42) 1px, transparent 1px),
        linear-gradient(rgba(203, 213, 225, .42) 1px, transparent 1px),
        #eef3f8;
    background-size: 28px 28px;
    padding: var(--space-6);
}

.ticket-template-page {
    --template-page-w: 210;
    --template-page-h: 148;
    --ticket-left: 0%;
    --ticket-top: 0%;
    --ticket-width: 100%;
    --ticket-height: 100%;
    position: relative;
    width: min(100%, 820px);
    min-height: 0;
    aspect-ratio: var(--template-page-w) / var(--template-page-h);
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-md);
}

.ticket-template-page-label {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, .88);
    color: var(--muted-strong);
    font-size: .72rem;
    font-weight: 760;
}

.preview-canvas,
.ticket-template-preview {
    position: relative;
    min-height: 0;
}

.ticket-template-preview {
    position: absolute;
    left: var(--ticket-left);
    top: var(--ticket-top);
    width: var(--ticket-width);
    height: var(--ticket-height);
    overflow: hidden;
    border: 2px solid var(--ticket-primary, var(--primary));
    background: #fff;
    color: var(--ticket-secondary, var(--heading));
    touch-action: none;
}

.preview-bg {
    position: absolute;
    inset: 0;
    background-image: var(--ticket-bg);
    background-size: cover;
    background-position: center;
    opacity: .98;
}

.preview-canvas {
    position: absolute;
    inset: 0;
}

.preview-element {
    position: absolute;
    border: 0;
    padding: 0;
    color: var(--ticket-secondary, var(--heading));
    line-height: 1.2;
    cursor: move;
    user-select: none;
    touch-action: none;
}

.preview-element[hidden] {
    display: none !important;
}

.preview-element.is-selected {
    outline: 2px solid var(--primary);
    outline-offset: 0;
    box-shadow: 0 0 0 4px var(--focus);
    background: rgba(255, 255, 255, .28);
}

.preview-element.is-dragging,
.preview-element.is-resizing {
    opacity: .84;
}

.resize-handle {
    position: absolute;
    width: 9px;
    height: 9px;
    border: 1px solid #fff;
    border-radius: 999px;
    background: var(--primary);
}

.resize-handle-se { right: -5px; bottom: -5px; cursor: nwse-resize; }
.resize-handle-nw { top: -5px; left: -5px; cursor: nwse-resize; }
.resize-handle-ne { top: -5px; right: -5px; cursor: nesw-resize; }
.resize-handle-sw { bottom: -5px; left: -5px; cursor: nesw-resize; }
.resize-handle-n { top: -5px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.resize-handle-s { bottom: -5px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.resize-handle-e { top: 50%; right: -5px; transform: translateY(-50%); cursor: ew-resize; }
.resize-handle-w { top: 50%; left: -5px; transform: translateY(-50%); cursor: ew-resize; }

.template-element-picker .button.is-active {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.template-element-picker .button.is-hidden {
    opacity: .55;
}

.ticket-studio-inspector .template-element-picker,
.ticket-studio-inspector .template-add-toolbar {
    align-items: stretch;
}

.ticket-studio-inspector .template-element-picker .button,
.ticket-studio-inspector .template-add-toolbar .button {
    flex: 1 1 calc(50% - var(--space-2));
    justify-content: center;
}

.ticket-studio-inspector .template-active-bar {
    justify-content: space-between;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: var(--space-3);
    background: var(--surface-soft);
}

.ticket-studio-inspector .template-active-bar span {
    display: block;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.ticket-box-control,
.template-element-control,
.custom-element-control {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ticket-box-control legend,
.template-element-control legend,
.custom-element-control legend {
    grid-column: 1 / -1;
}

.ticket-size-presets,
.template-content-field,
.template-remove-button,
.custom-text-field,
.custom-image-field,
.custom-element-control .button {
    grid-column: 1 / -1;
}

.ticket-studio-inspector .template-element-control {
    display: none;
}

.ticket-studio-inspector .template-element-control.is-active,
.ticket-studio-inspector .custom-element-control.is-active {
    display: grid;
}

.preview-logo.placeholder,
.preview-event-image.placeholder,
.custom-image-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-sm);
    background: rgba(248, 250, 252, .8);
    color: var(--muted);
    font-weight: 760;
}

.preview-logo-box img,
.preview-event-image-box img,
.preview-qr img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.preview-event-image-box img {
    object-fit: cover;
}

.preview-event-box p,
.preview-rules-box {
    color: inherit;
    font-size: var(--preview-font-9, 9px);
}

.preview-event-box h3,
.preview-event-title-box {
    color: var(--ticket-primary, var(--primary));
    font-size: var(--preview-font-12, 12px);
    font-weight: 700;
    line-height: 1.15;
}

.preview-event-date-box,
.preview-event-time-box,
.preview-event-place-box,
.preview-organizer-box {
    font-size: var(--preview-font-9, 9px);
    font-weight: 700;
    line-height: 1.2;
    color: var(--ticket-secondary, var(--heading));
}

.preview-seat-box {
    color: var(--ticket-primary, var(--primary));
    font-size: var(--preview-font-20, 20px);
    font-weight: 700;
}

.preview-customer-box,
.preview-price-box {
    font-size: var(--preview-font-10, 10px);
}

.preview-qr {
    display: grid;
    place-items: center;
    border: 0;
    background: #fff;
    color: var(--heading);
    font-weight: 850;
}

.template-content-field,
.custom-preview-element,
.custom-image-placeholder {
    display: block;
}

.custom-preview-element img,
.preview-logo,
.preview-event-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.color-swatch {
    width: 22px;
    height: 22px;
    display: inline-block;
    border: 1px solid var(--line);
    border-radius: 999px;
    vertical-align: middle;
}

.price-seat-grid {
    display: grid;
    grid-template-columns: repeat(var(--seat-columns, 10), minmax(74px, 1fr));
    gap: var(--space-2);
    overflow-x: auto;
}

.price-seat-tile {
    display: grid;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: var(--space-2);
    background: #fff;
}

.modal,
.dialog,
.drawer,
[role="dialog"] {
    border-radius: var(--radius-lg);
}

.offline-banner {
    position: fixed;
    left: 50%;
    bottom: 18px;
    z-index: 300;
    transform: translateX(-50%);
    max-width: min(560px, calc(100% - 24px));
    border: 1px solid #fecaca;
    border-radius: var(--radius);
    padding: 12px 14px;
    background: var(--danger-soft);
    color: var(--danger);
    box-shadow: var(--shadow-md);
    font-weight: 780;
}

.shell-scrim {
    position: fixed;
    inset: 0;
    z-index: 170;
    background: rgba(15, 23, 42, .42);
}

[hidden] {
    display: none !important;
}

@media (max-width: 1180px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(var(--sidebar-w), calc(100vw - 48px));
        transform: translateX(-105%);
        transition: transform .18s ease;
        box-shadow: var(--shadow-md);
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .mobile-menu-button {
        display: inline-flex;
    }

    .topbar {
        padding-inline: var(--space-4);
    }

    .breadcrumbs {
        flex: 1 1 auto;
    }

    .topbar-search {
        flex: 1 1 260px;
    }

    .notification-menu {
        margin-left: 0;
    }

    .page-header.row > .row-actions,
    .page-header.row > .settings-status {
        flex-basis: 100%;
        justify-content: flex-start;
    }

    .settings-layout,
    .dashboard-work-grid,
    .detail-layout,
    .record-layout,
    .ticket-studio-grid,
    .ticket-template-layout,
    .ticket-card-layout,
    .hall-seat-editor-layout,
    .pos-layout,
    .pos-workspace,
    .public-booking-layout,
    .reservation-layout {
        grid-template-columns: 1fr;
    }

    .pos-layout,
    .pos-workspace {
        grid-template-areas:
            "setup"
            "plan"
            "tickets"
            "actions";
    }

    .settings-side,
    .ticket-studio-setup,
    .ticket-studio-inspector,
    .seat-editor-panel,
    .pos-setup-panel,
    .pos-ticket-panel,
    .pos-actions-panel,
    .booking-info-panel,
    .reservation-sidebar {
        position: static;
        max-height: none;
    }

    .ticket-studio-grid {
        grid-template-columns: 1fr;
    }

    .ticket-studio-bar {
        position: static;
        margin: 0 0 var(--space-4);
        flex-wrap: wrap;
    }

    .ticket-preview-scroll {
        min-height: 620px;
        max-height: 72vh;
    }

    .pos-page-header {
        display: block;
    }

    .settings-link-card {
        display: grid;
    }

    .email-template-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .topbar {
        flex-wrap: wrap;
    }

    .logout-form {
        margin-left: 0;
    }

    .panel-header {
        display: grid;
        grid-template-columns: 1fr;
        justify-items: start;
    }

    .panel-header .button,
    .panel-header form {
        width: 100%;
    }

    .workstream-grid,
    .public-event-detail,
    .event-profile,
    .reservation-event-summary {
        grid-template-columns: 1fr;
    }

    .public-hero,
    .public-home-hero,
    .public-toolbar {
        grid-template-columns: 1fr;
    }

    .public-event-detail-poster {
        height: auto;
        max-height: 420px;
    }

    .form-grid,
    .form-grid.three,
    .reports-toolbar,
    .reservations-filter,
    .settings-category-form,
    .settings-category-item,
    .settings-copy-row {
        grid-template-columns: 1fr;
    }

    .nav-menu-panel,
    .nav-menu.nav-menu-wide .nav-menu-panel {
        width: min(100vw - 24px, 560px);
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .page {
        width: 100%;
        margin: var(--space-4) 0 48px;
        padding-inline: 10px;
    }

    .page-header.row {
        align-items: stretch;
        flex-direction: column;
    }

    .row-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
        justify-content: stretch;
    }

    .row-actions .button,
    .row-actions form {
        width: 100%;
        min-width: 0;
        flex: 1 1 100%;
    }

    .action-row {
        display: grid;
        grid-template-columns: 1fr;
        justify-content: stretch;
    }

    .action-row .button,
    .action-row form {
        width: 100%;
    }

    .event-row,
    .event-card,
    .event-card.has-poster {
        grid-template-columns: 70px minmax(0, 1fr);
    }

    .event-card.has-poster .public-event-poster {
        grid-column: 1 / -1;
        grid-row: 1;
        width: 100%;
        height: 170px;
    }

    .event-card.has-poster .event-date {
        grid-column: 1;
        grid-row: 2;
    }

    .event-card.has-poster .event-main {
        grid-column: 2;
        grid-row: 2;
    }

    .event-action {
        grid-column: 1 / -1;
        justify-items: stretch;
    }

    .event-action .badge {
        justify-self: start;
    }

    .month-switcher,
    .public-filter,
    .reservation-step-actions,
    .ticket-attendee-header,
    .seat-panel-header {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

    .month-switcher {
        text-align: center;
    }

    .public-calendar-month {
        gap: 5px;
        padding: var(--space-2);
    }

    .calendar-cell {
        min-height: 62px;
        padding: var(--space-2);
    }

    .calendar-cell span {
        font-size: .68rem;
    }

    .reservation-steps {
        grid-template-columns: 1fr;
    }

    .responsive-cards,
    .responsive-cards thead,
    .responsive-cards tbody,
    .responsive-cards tr,
    .responsive-cards th,
    .responsive-cards td {
        display: block;
    }

    .responsive-cards thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }

    .responsive-cards tbody {
        display: grid;
        gap: var(--space-3);
        padding: var(--space-2);
    }

    .responsive-cards tr {
        width: 100%;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: #fff;
        overflow: hidden;
    }

    .responsive-cards td {
        display: grid;
        grid-template-columns: minmax(104px, 28%) minmax(0, 1fr);
        gap: var(--space-3);
        min-height: 38px;
        border-bottom: 1px solid var(--line);
        white-space: normal;
    }

    .table-wrap th:last-child,
    .table-wrap td:last-child {
        position: static;
        right: auto;
        border-left: 0;
    }

    .responsive-cards td.row-actions {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .responsive-cards td.row-actions::before {
        margin-bottom: -4px;
    }

    .responsive-cards td.row-actions .button,
    .responsive-cards td.row-actions form,
    .responsive-cards td.row-actions details,
    .responsive-cards td.row-actions summary {
        width: 100%;
    }

    .responsive-cards td.row-actions .toolbar-form,
    .responsive-cards td.row-actions .ticket-row-operation form {
        grid-template-columns: 1fr;
        margin-bottom: 0;
        padding: var(--space-3);
    }

    .responsive-cards td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: .72rem;
        font-weight: 820;
        text-transform: uppercase;
    }

    .responsive-cards td[colspan] {
        display: grid;
        grid-template-columns: 1fr;
        place-items: center;
    }

    .responsive-cards td[colspan]::before {
        content: none;
    }
}

@media (max-width: 560px) {
    h1 {
        font-size: 1.45rem;
    }

    .topbar {
        gap: var(--space-2);
        padding: var(--space-3);
    }

    .staff-shell .topbar {
        display: grid;
        grid-template-columns: var(--control-h) minmax(0, 1fr);
        align-items: center;
    }

    .staff-shell .logout-form {
        justify-content: end;
    }

    .public-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .public-nav {
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
    }

    .breadcrumbs,
    .logout-form span,
    .brand small {
        display: none;
    }

    .topbar-search {
        width: 100%;
        order: 4;
        grid-column: 1 / -1;
        flex-basis: 100%;
        max-width: none;
    }

    .settings-status {
        width: 100%;
        justify-content: flex-start;
    }

    .panel,
    .auth-panel,
    .scanner-panel {
        padding: var(--space-4);
    }

    .public-page {
        width: 100%;
        margin-top: var(--space-4);
        padding-inline: 10px;
    }

    .public-hero,
    .public-home-hero,
    .public-event-copy {
        padding: var(--space-5);
    }

    .public-hero h1,
    .public-home-hero h1,
    .public-event-copy h1,
    .confirmation-panel h1 {
        font-size: 1.45rem;
    }

    .hero-metrics {
        display: grid;
        grid-template-columns: 1fr;
    }

    .hero-metrics span {
        min-width: 0;
    }

    .event-row,
    .event-card,
    .event-card.has-poster {
        grid-template-columns: 1fr;
    }

    .event-card.has-poster .public-event-poster,
    .event-card.has-poster .event-date,
    .event-card.has-poster .event-main {
        grid-column: 1;
        grid-row: auto;
    }

    .event-date {
        width: 76px;
    }

    .confirmation-panel .summary-list,
    .summary-list,
    .details-list {
        grid-template-columns: 1fr;
    }

    .stats-grid,
    .quick-actions {
        grid-template-columns: 1fr;
    }

    .seat-map-viewport {
        min-height: 340px;
    }

    .pos-layout .seat-sector-grid,
    .public-seat-map .seat-sector-grid {
        grid-template-columns: 34px repeat(var(--seat-columns, 10), 32px);
    }
}
