.app .tables-page { max-width:none; min-width:0; }
.app .table-navigation,.app .active-filters,.app .schedule-modes,.app .schedule-month-picker,.app .table-toolbar {
 display:flex; flex-wrap:wrap; align-items:center; gap:6px;
}
.app .table-navigation { margin-bottom:10px; }
.app .table-controls { padding:6px 8px; border:1px solid var(--divider); border-radius:10px; background:var(--surface); }
.app .table-toolbar { position:relative; }
.app .table-controls .workflow-error:empty,.app .column-menu .workflow-error:empty { display:none; }
.app .table-controls summary.btn { display:flex; align-items:center; gap:6px; padding-inline:9px; }
.app .table-controls summary.btn::-webkit-details-marker { display:none; }
.app .table-controls summary.btn::after { content:'▾'; color:var(--accent); }
.app .table-controls summary.btn:focus-visible { outline:3px solid var(--accent); outline-offset:1px; }
.app .table-filter-panel summary span,.app .mobile-venue-label { color:var(--secondary); }
.app .table-filter-panel,.app .table-column-picker { position:relative; min-width:0; }
.app #period-form,.app .table-filter-options {
 position:absolute; z-index:5; top:calc(100% + 4px); padding:10px; width:min(21rem,calc(100vw - 48px));
 background:var(--surface); box-shadow:0 7px 24px #1727172e; border:1px solid var(--divider); border-radius:10px;
}
.app #period-form { left:0; display:grid; gap:8px; }
.app #period-form .btn { justify-self:start; }
.app .table-filter-options { right:0; }
.app .table-filter-columns { display:flex; flex-wrap:wrap; gap:6px; max-height:50vh; overflow:auto; }
.app .table-filter-columns .column-sort,.app .active-filters .column-sort { border:1px solid var(--divider); border-radius:8px; }
.app .table-venue-desktop .demo-input { display:flex; align-items:center; gap:6px; }
.app .table-venue-desktop select { max-width:11.5rem; }
.app .table-venue-mobile,.app .mobile-venue-label,.app .mobile-filter-only,.app .table-export-mobile { display:none; }
.app .active-filters { margin-top:6px; }
.app .column-order-guide { display:flex; flex-wrap:wrap; align-items:center; gap:6px 12px; margin-top:6px; }
.app .column-order-guide p { margin:0; color:var(--secondary); font-size:.875rem; }
.app #table-column-order[aria-pressed="true"] { background:#edf6ec; color:var(--accent); border-color:var(--accent); }
.app .column-handle { display:flex; align-items:center; gap:6px; min-height:44px; min-width:44px; padding:4px 6px; border:1px solid var(--divider); border-radius:7px; background:var(--surface); color:var(--ink); text-align:left; cursor:grab; user-select:none; }
.app .column-handle span { color:var(--accent); }
.app .column-ordering thead th:first-child { left:auto; }
.app .is-dragging-column .column-handle { cursor:grabbing; }
.app [data-order-slot][data-column-dragging] .column-handle { background:#e3f1e3; border-color:var(--accent); }
.app .is-dragging-column { position:relative; }
.app .column-drop-line { position:absolute; z-index:5; width:3px; transform:translateX(-50%); background:var(--accent); pointer-events:none; }
.app .column-drop-line[data-current=true] { opacity:.3; }
.column-drop-label {
 position:fixed; z-index:110; max-width:min(23rem,calc(100vw - 16px)); padding:8px 10px; border-radius:8px;
 background:#235d2a; color:#fff; box-shadow:0 2px 8px #142d2545; font-size:.875rem; line-height:1.3;
 overflow-wrap:anywhere; pointer-events:none;
}
.app .touch-column-order,.app .touch-order-menu { display:none; }
.app .live-data-table th .column-sort span { font-size:.875rem; }
.app .column-condition summary { min-height:44px; padding:10px 8px; cursor:pointer; color:var(--accent); font-weight:700; }
.app .table-status { margin-block:6px; color:var(--secondary); font-size:.875rem; }
.app .table-scroll { max-width:100%; max-height:70vh; overflow:auto; border:1px solid var(--divider); border-radius:10px; background:var(--surface); }
.app .live-data-table,.app .schedule-table { width:100%; border-collapse:separate; border-spacing:0; color:var(--ink); text-align:left; }
.app .table-scroll thead th { position:sticky; top:0; z-index:2; background:#eef4ee; box-shadow:0 1px 0 var(--divider); }
.app .table-scroll thead th:first-child { left:0; z-index:3; }
.app .live-data-table td,.app .live-data-table th { min-width:6rem; max-width:18rem; padding:2px 10px; border-bottom:1px solid var(--divider); overflow-wrap:anywhere; vertical-align:middle; }
.app .live-data-table td:first-child,.app .schedule-day > th { position:sticky; left:0; z-index:1; background:var(--surface); box-shadow:1px 0 0 var(--divider); }
.app .column-sort,.app .schedule-group {
 display:flex; align-items:center; gap:6px; border:0; background:transparent; padding:6px 8px; text-align:left;
 font:inherit; font-weight:700; min-height:44px; min-width:44px; color:var(--ink); cursor:pointer; overflow-wrap:anywhere;
}
.app .live-data-table th .column-sort { padding-inline:0; word-break:normal; overflow-wrap:normal; }
.app .live-data-table [data-field="date"],.app .live-data-table [data-field="time"] { width:9ch; min-width:9ch; white-space:nowrap; font-variant-numeric:tabular-nums; }
.app .live-data-table [data-field="group"],.app .live-data-table [data-field="workers"] { min-width:11rem; }
.app .live-data-table [data-field="group"] { font-weight:600; }
.app .schedule-list [data-field="program"],.app .schedule-list [data-field="transport"] { min-width:8rem; }
.app .schedule-list [data-field="place"] { min-width:7rem; }
.app .schedule-list [data-field="transport"] .table-cell-text { white-space:nowrap; }
.app .live-data-table .table-row-actions { width:9.5rem; white-space:nowrap; text-align:left; }
.app .table-row-actions > div { display:flex; gap:2px; }
.app .table-row-actions .btn { flex:none; border-color:var(--divider); background:var(--surface); padding-inline:6px; white-space:nowrap; overflow-wrap:normal; }
.app .table-row-actions .btn:hover,.app .table-row-actions .btn[aria-expanded="true"] { background:#e6efe6; color:var(--accent); }
.app .table-extra-row[hidden] { display:none !important; }
.app .column-sort span { color:var(--accent); flex:none; }
.app .column-sort:hover,.app .column-sort:focus-visible,.app .table-cell-edit:hover { background:#e6efe6; }
.app .live-data-table .table-extra-row td { position:static; max-width:0; padding:2px 10px; background:#f7f9f7; box-shadow:none; }
.app .schedule-program summary { min-height:44px; cursor:pointer; color:var(--accent); padding:10px 4px; overflow-wrap:anywhere; }
.app .table-detail-grid,.app .schedule-details { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(9rem,100%),1fr)); gap:8px; padding:8px 0; }
.app .table-detail-grid { max-width:calc(100vw - 64px); }
.app .table-detail-label { display:block; color:var(--secondary); font-size:.8125rem; margin-bottom:4px; }
.app .table-cell-edit {
 display:flex; align-items:center; justify-content:space-between; gap:6px; min-height:44px; width:100%; padding:6px;
 border:1px solid var(--divider); background:var(--surface); border-radius:8px; color:var(--ink); text-align:left;
 white-space:normal; overflow-wrap:anywhere; cursor:pointer;
}
.app .live-data-table .table-cell-edit { border-color:var(--divider); background:#f4f8f4; padding-left:6px; }
.app .live-data-table .table-cell-edit:hover { background:#eef4ee; }
.app .table-cell-edit span[aria-hidden] { flex:none; }
.app .table-edit-icon { color:var(--accent); font-size:1rem; line-height:1; }
.app .table-cell-text { min-width:0; overflow-wrap:anywhere; }
.app .table-totals { margin-top:16px; }
.app .table-totals dl { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(11rem,100%),1fr)); gap:12px; }
.app .table-totals dt { color:var(--secondary); font-size:.875rem; }
.app .table-totals dd { margin:4px 0 0; font-weight:700; overflow-wrap:anywhere; }
.app #table-editor form { scroll-margin-top:16px; }
.app #table-editor .assignment-editor { max-width:42rem; }
.app #table-editor fieldset { border:1px solid var(--divider); border-radius:12px; margin:16px 0; padding:16px; min-width:0; }
.app #table-editor legend { color:var(--ink); font-weight:700; overflow-wrap:anywhere; }
.app .sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.app .mobile-table-select,.app .schedule-mobile-place,.app .schedule-empty-label,.app .schedule-mobile-columns { display:none; }
.app .schedule-modes button[aria-pressed="true"],.app .column-menu-sort button[aria-pressed="true"] {
 border-color:var(--accent); color:var(--accent); background:#eef4ee;
}
.app .schedule-month-picker strong { min-width:8rem; text-align:left; text-transform:capitalize; }
.app .schedule-table th { padding:4px 8px; vertical-align:top; }
.app .schedule-table thead th > strong { display:block; padding:4px; overflow-wrap:anywhere; }
.app .schedule-table thead th:first-child,.app .schedule-day > th { width:1%; min-width:6rem; }
.app .schedule-day > th,.app .schedule-day > td { border-bottom:3px solid #d5e5d5; }
.app .schedule-day > th { padding:7px 8px; font-size:.875rem; }
.app .schedule-day > td { min-width:16.5rem; vertical-align:top; padding:0 8px; border-left:1px solid var(--divider); }
.app .schedule-fields { display:grid; grid-template-columns:minmax(0,.85fr) minmax(0,1fr) minmax(0,1.15fr); align-items:start; gap:6px; overflow-wrap:anywhere; }
.app .schedule-fields > div { min-width:0; }
.app .schedule-fields .column-sort { padding-inline:2px; font-size:.75rem; gap:3px; overflow-wrap:normal; }
.app .schedule-fields .column-sort span { font-size:.625rem; }
.app .schedule-workers .table-cell-edit { font-size:.875rem; gap:4px; padding-inline:4px; overflow-wrap:break-word; }
.app .schedule-fields small { display:block; color:var(--secondary); }
.app .schedule-program { padding-block:6px; }
.app .schedule-program + .schedule-program { border-top:1px solid var(--divider); }
.app .schedule-program > details { font-size:.875rem; }
.app .schedule-group { color:var(--accent); text-decoration:underline; padding-inline:0; }
.app .schedule-dash { display:block; padding:5px 0; color:var(--secondary); }
.app .column-menu {
 position:fixed; inset:auto; margin:0; padding:0; width:min(23rem,calc(100vw - 24px)); max-height:min(39rem,calc(100dvh - 24px));
 border:1px solid var(--divider); border-radius:14px; color:var(--ink); background:var(--surface); box-shadow:0 10px 36px #17271736;
}
.app .column-menu::backdrop { background:#15231532; }
.app .column-menu form { display:flex; flex-direction:column; max-height:inherit; margin:0; }
.app .column-menu-header,.app .column-menu-actions { flex:none; display:flex; align-items:center; justify-content:space-between; gap:8px; padding:8px 12px; }
.app .column-menu-header { border-bottom:1px solid var(--divider); }
.app .column-menu-header h3 { margin:0; }
.app .column-menu-header button { min-width:44px; }
.app .column-menu-actions { border-top:1px solid var(--divider); justify-content:flex-end; }
.app .column-menu-body { min-height:0; overflow:auto; padding:8px 12px; }
.app .column-menu-sort,.app .column-condition > div { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
.app .column-menu-sort .btn { padding-inline:6px; text-wrap:balance; }
.app .column-values { min-width:0; border:0; margin:0; padding:0; }
.app .column-values legend { font-weight:700; margin-bottom:4px; }
.app .column-values input[type=search] {
 width:100%; min-height:44px; padding:8px 10px; border:1px solid var(--divider); border-radius:8px;
 background:var(--surface); color:var(--ink); font:inherit;
}
.app .column-check {
 display:grid; grid-template-columns:1.25rem minmax(0,1fr) auto; align-items:center; gap:8px; min-height:44px;
 padding:3px 6px; cursor:pointer; overflow-wrap:anywhere; font-size:.9375rem;
}
.app .column-check input[type=checkbox] { width:1.15rem; height:1.15rem; margin:0; accent-color:var(--accent); }
.app .column-check:hover { background:#eef4ee; }
.app .column-value-list { max-height:clamp(5rem,26dvh,13rem); overflow:auto; overscroll-behavior:contain; border-block:1px solid var(--divider); }
.app .column-value-list p,.app .column-status { margin:6px 0; color:var(--secondary); font-size:.875rem; }
.app .column-count { color:var(--secondary); font-variant-numeric:tabular-nums; }
@media(max-width:700px) {
 .app #table-editor .assignment-editor { scroll-margin-bottom:calc(var(--mobile-nav-height,56px) + 12px); }
 .app #table-editor .assignment-editor .actions { display:flex; flex-wrap:wrap; }
 .app #table-editor .assignment-editor .actions .btn { width:auto; white-space:normal; }
 .app .mobile-table-select { display:block; margin-bottom:10px; }
 .app .mobile-table-select select { width:100%; }
 .app .table-navigation { display:none; }
 .app .table-scroll { max-height:none; }
 .app .live-data-table th:first-child,.app .live-data-table .table-summary-row td:first-child { min-width:5rem; max-width:8rem; }
 .app .live-data-table th,.app .live-data-table td { padding-inline:6px; }
 .app .mobile-table-select .demo-input > span { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
 .app .table-toolbar { column-gap:5px; }
 .app .column-order-long { display:none; }
 .app .table-filter-panel summary span { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
 .app .table-venue-desktop,.app .table-export-desktop { display:none; }
 .app .table-export-mobile { display:block; margin-top:8px; }
 .app .mobile-filter-only,.app .table-venue-mobile { display:block; }
 .app .mobile-venue-label { display:inline; max-width:8rem; overflow:hidden; text-overflow:ellipsis; }
 .app .table-filter-panel,.app .table-column-picker { position:static; }
 .app .table-filter-options,.app #period-form { left:0; right:0; width:auto; }
 .app .table-venue-mobile + .table-filter-columns:not(:empty) { margin-top:8px; }
 .app .schedule-list-scroll { max-height:none; overflow:visible; }
 .app .schedule-list:not(.schedule-ordered),.app .schedule-list:not(.schedule-ordered) tbody { display:block; min-width:0; }
 .app .schedule-list:not(.schedule-ordered) thead { display:none; }
 .app .schedule-list:not(.schedule-ordered) .table-summary-row { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); padding:8px 10px 2px; gap:2px 8px; border-bottom:1px solid var(--divider); }
 .app .schedule-list:not(.schedule-ordered) .table-summary-row > td { display:block; position:static; width:auto; min-width:0; max-width:none; padding:0; border:0; box-shadow:none; white-space:normal; }
 .app .schedule-list:not(.schedule-ordered) [data-field="group"] { grid-column:1/-1; grid-row:1; }
 .app .schedule-list:not(.schedule-ordered) [data-field="time"] { grid-area:2 / 1; }
 .app .schedule-list:not(.schedule-ordered) [data-field="program"] { grid-area:2 / 2; }
 .app .schedule-list:not(.schedule-ordered) [data-field="date"],.app .schedule-list:not(.schedule-ordered) [data-field="place"] { grid-row:3; color:var(--secondary); font-size:.875rem; }
 .app .schedule-list:not(.schedule-ordered).is-venue-filtered .table-summary-row [data-field="place"] { display:none; }
 .app .schedule-list:not(.schedule-ordered) [data-field="workers"],.app .schedule-list:not(.schedule-ordered) [data-field="transport"] { grid-row:4; font-size:.875rem; }
 .app .schedule-list:not(.schedule-ordered) .table-row-actions { grid-column:1/-1; }
 .app .schedule-list:not(.schedule-ordered) .table-extra-row,.app .schedule-list:not(.schedule-ordered) .table-extra-row td { display:block; max-width:none; }
 .app .schedule-list:not(.schedule-ordered) .table-detail-grid { max-width:none; }
 .app .schedule-scroll { max-height:none; overflow:visible; border:0; background:transparent; }
 .app .schedule-table,.app .schedule-table tbody,.app .schedule-day,.app .schedule-day > th,.app .schedule-day > td { display:block; width:auto; }
 .app .schedule-mobile-columns { display:flex; flex-wrap:wrap; gap:4px; margin-bottom:8px; }
 .app .schedule-mobile-columns .column-sort { flex:1 0 auto; font-size:.875rem; padding-inline:6px; background:#eef4ee; border-radius:8px; }
 .app .schedule-program .schedule-fields { grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
 .app .schedule-workers { grid-column:1/-1; font-size:.875rem; }
 .app .schedule-workers .table-cell-edit { width:auto; max-width:100%; padding-inline:8px; }
 .app .schedule-table thead,.app .schedule-day > td.schedule-place-empty { display:none; }
 .app .schedule-day { margin-bottom:6px; border:1px solid var(--divider); border-radius:9px; background:var(--surface); }
 .app .schedule-day > th { position:static; padding:8px; box-shadow:none; border-bottom:1px solid var(--divider); background:#eef4ee; border-radius:8px 8px 0 0; }
 .app .schedule-day-empty > th { display:flex; justify-content:space-between; align-items:center; gap:8px; border:0; border-radius:8px; font-weight:500; }
 .app .schedule-day > td { min-width:0; border:0; padding:8px; }
 .app .schedule-day > td + td:not(.schedule-place-empty) { border-top:1px solid var(--divider); }
 .app .schedule-mobile-place { display:block; color:var(--accent); }
 .app .schedule-day-empty .schedule-empty-label { display:inline; font-size:.8125rem; color:var(--secondary); }
 .app .column-menu { inset:auto 0 var(--menu-bottom,0px) !important; width:100%; max-width:none; max-height:min(40rem,var(--menu-height,90dvh)); border-radius:16px 16px 0 0; }
 .app .column-menu-actions { padding-bottom:calc(8px + env(safe-area-inset-bottom)); }
}

@media(max-width:700px), (hover:none) and (pointer:coarse) {
 .app .desktop-order-help,.app .desktop-order-handle { display:none; }
 .app .touch-order-menu,.app .touch-column-order { display:block; }
 .app .table-scroll { max-height:none; }
 .app .column-ordering thead th:first-child { left:0; }
 .app .touch-column-order { margin-block:6px 0; }
 .app .touch-column-order p { margin:0 0 6px; color:var(--secondary); font-size:.875rem; }
 .app .column-order-strip { display:flex; gap:6px; max-width:100%; overflow-x:auto; padding:2px 1px 5px; }
 .app .column-order-chip { display:flex; flex:none; align-items:stretch; border:1px solid var(--divider); border-radius:8px; }
 .app .column-order-chip .column-handle { flex:none; justify-content:center; border:0; border-inline-end:1px solid var(--divider); border-radius:7px 0 0 7px; touch-action:none; }
 .app .column-order-name { min-height:44px; padding:6px 10px; border:0; border-radius:0 7px 7px 0; background:var(--surface); color:var(--ink); white-space:nowrap; }
 .app .column-order-name[aria-pressed=true] { background:#e3f1e3; color:var(--accent); }
 .app .column-order-steps { display:flex; gap:6px; align-items:center; }
 .app .column-order-selected { color:var(--secondary); overflow-wrap:anywhere; }
}

.app .table-visibility { position: relative; }
.app .table-visibility form { background: var(--surface); padding: 12px; }
.app .table-visibility-list { max-height: 16rem; overflow: auto; }
.app .live-data-table tfoot.table-totals td { background: var(--surface); font-weight: 600; }
.app .table-payroll-person { min-width: 15rem; }
.app .table-payroll-person small { display: block; }

.app #cook-settlement > summary, .app #assignment-batch > summary { min-height: 44px; align-content: center; cursor: pointer; }

.app .live-data-table tfoot { position: relative; }


.app .staff-table :is(th,td)[data-field="name"] { min-width:9rem; }
.app .staff-table :is(th,td)[data-field="rank"] { min-width:7rem; }
.app .staff-table th[data-field="effective_date"] { min-width:8rem; }
