/* ══════════════════════════════════════════════════════════
   Event, Studio & Billing — one shared look (pagination, record detail windows, status bar, two-column sections).
   Every rule here uses its own mx-* classes (or the eav-main.is-single modifier), which only the Event AV, Studio
   Booking and Billing screens put on their elements, so no other screen of the app changes.
   ══════════════════════════════════════════════════════════ */

/* ── Pagination ───────────────────────────────────────────── */
/* count on the left, page buttons in the centre, rows on the right */
.mx-pager { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px 16px; padding: 12px 18px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-secondary); }
.mx-pager-info { justify-self: start; }
.mx-pager-pages { justify-self: center; }
.mx-pager-size { justify-self: end; }
.mx-pager-info b { color: var(--text-primary); font-weight: 600; }
.mx-pager-pages { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.mx-pg { appearance: none; font: inherit; font-size: 13px; font-weight: 600; min-width: 34px; height: 34px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-primary); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background .12s, border-color .12s; }
.mx-pg:hover:not(:disabled):not(.on) { border-color: var(--accent); color: var(--accent); }
.mx-pg:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mx-pg.on { background: var(--accent); border-color: var(--accent); color: #fff; cursor: default; }
.mx-pg:disabled { opacity: .45; cursor: not-allowed; }
.mx-pg i { font-size: 11px; }
.mx-pg-gap { padding: 0 4px; color: var(--text-muted); }
.mx-pager-size { display: inline-flex; align-items: center; gap: 6px; }
.mx-pager-size select { height: 34px; border-radius: 9px; border: 1px solid var(--border); background: var(--bg-card); padding: 0 8px; font: inherit; color: var(--text-primary); }
@media (max-width: 640px) {
  /* phones: count on top, then the page buttons, then rows */
  .mx-pager { grid-template-columns: minmax(0, 1fr); justify-items: center; padding: 12px; }
  .mx-pager-info, .mx-pager-pages, .mx-pager-size { justify-self: center; }
  .mx-pager-pages:empty { display: none; }
  .mx-pg-nav span { display: none; }
}

/* ── Lists without the side panel ─────────────────────────── */
.eav-main.is-single { grid-template-columns: minmax(0, 1fr); }

/* ── Record detail window (Event / Studio): header and actions stay in view, only the middle scrolls ── */
.modal.mx-detail { display: flex; flex-direction: column; overflow: hidden; max-height: 92vh; }
.modal.mx-detail > .eav-dh, .modal.mx-detail > .mx-statusbar, .modal.mx-detail > .modal-footer { flex: 0 0 auto; }
.modal.mx-detail > .eav-db { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; padding-bottom: 24px; }
.modal.mx-detail > .modal-footer { border-top: 1px solid var(--border); background: var(--bg-card); display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center; padding: 12px 22px; }
.modal.mx-detail .mx-foot-left { margin-right: auto; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.modal.mx-detail .eav-dh { padding-bottom: 14px; }

/* status bar right under the header */
.mx-statusbar { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; padding: 12px 24px; background: var(--bg-secondary, #f8fafc); border-bottom: 1px solid var(--border); }
.mx-statusbar-l { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; color: var(--text-muted); }
.mx-seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px; border-radius: 11px; background: var(--bg-card); border: 1px solid var(--border); }
.mx-seg button { appearance: none; font: inherit; font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 8px; border: 0; background: transparent; color: var(--text-secondary); cursor: pointer; white-space: nowrap; }
.mx-seg button:hover:not(.on) { background: var(--accent-light); color: var(--accent); }
.mx-seg button.on { background: var(--accent); color: #fff; cursor: default; }
.mx-seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.mx-statusbar .mx-hint { font-size: 12px; color: var(--text-muted); }

/* sections side by side on wide screens */
.mx-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.mx-grid2 > .eav-sec .eav-kv { grid-template-columns: minmax(0, 1fr); }
.mx-card { border: 1px solid var(--border); border-radius: 12px; padding: 4px 16px 14px; margin-top: 16px; background: var(--bg-card); }
.mx-card > .eav-sec:first-child { margin-top: 12px; }
@media (max-width: 760px) {
  .mx-grid2 { grid-template-columns: minmax(0, 1fr); }
  .modal.mx-detail { max-height: 100vh; border-radius: 0; }
  .mx-statusbar, .modal.mx-detail > .modal-footer { padding-left: 16px; padding-right: 16px; }
  .modal.mx-detail > .eav-db { padding-left: 16px; padding-right: 16px; }
  .modal.mx-detail > .modal-footer .btn { flex: 1 1 auto; justify-content: center; }
  .mx-seg { width: 100%; }
  .mx-seg button { flex: 1 1 auto; }
}

/* ── KPI strip with four cards (Billing) ───────────────────── */
.mx-kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .mx-kpis-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mx-pill-n { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 999px; background: rgba(15,23,42,.08); font-size: 11px; line-height: 16px; text-align: center; }
.eav-pill.on .mx-pill-n { background: rgba(255,255,255,.25); }

/* ── Users & Access: readable people table ───────────────────── */
.ax-count { padding: 10px 16px 0; font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
.ax-table th.ax-th-person { min-width: 280px; }
.ax-table td.ax-cell-person { min-width: 280px; max-width: 380px; }
.ax-person { align-items: center; }
.ax-id { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.ax-id b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ax-email { display: block; font-size: 12.5px; color: var(--text-secondary); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
.ax-email:hover { color: var(--accent); text-decoration: underline; }
.ax-flag { margin-top: 3px; font-size: 11.5px; color: #b45309; }
.ax-cell-org { white-space: nowrap; font-weight: 600; }
.ax-cell-role { white-space: nowrap; }
.ax-opens { display: block; margin-top: 4px; font-size: 11.5px; color: var(--text-muted); }
.ax-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.ax-status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.ax-status-on { color: #15803d; }
.ax-status-off { color: var(--text-muted); }
.ax-row-off td { background: color-mix(in srgb, var(--bg-card) 92%, var(--border)); }
.ax-row-off .ax-id b, .ax-row-off .ax-email { color: var(--text-muted); }
.ax-act { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: nowrap; }
.ax-icon-btn { width: 34px; padding-left: 0; padding-right: 0; justify-content: center; }
.ax-icon-btn.ax-del:hover { color: #b91c1c; border-color: #fca5a5; }
@media (max-width: 900px) {
  .ax-table td.ax-cell-person { min-width: 0; max-width: none; }
  .ax-email { white-space: normal; overflow-wrap: anywhere; }
}

/* ── Create / manage organization (Platform) ─────────────────── */
.orgw-steps { display: flex; gap: 8px; list-style: none; margin: 0 0 16px; padding: 0; flex-wrap: wrap; }
.orgw-steps li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--accent-light); color: var(--accent); font-size: 12.5px; font-weight: 700; }
.orgw-steps li span { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 11px; }
.orgw-sec { border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px 4px; margin-bottom: 14px; background: var(--bg-card); }
.orgw-sec > h4 { margin: 0 0 10px; font-size: 12px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--text-secondary); display: flex; align-items: center; gap: 8px; }
.orgw-sec > h4 i { color: var(--accent); }
.orgw-note { margin: -4px 0 12px; font-size: 12.5px; color: var(--text-secondary); }
.orgw-admin { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.orgw-mods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.orgw-mod { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 12px; cursor: pointer; margin: 0; }
.orgw-mod input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.orgw-mod.on { border-color: var(--accent); background: var(--accent-light); }
.orgw-mod:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.orgw-mod-ic { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: var(--bg-secondary, #f1f5f9); color: var(--accent); }
.orgw-mod-t { flex: 1; min-width: 0; }
.orgw-mod-t b { display: block; font-size: 13.5px; }
.orgw-mod-t small { display: block; font-size: 11.5px; color: var(--text-secondary); line-height: 1.3; }
.orgw-mod .ax-switch { flex: none; }
.orgw-mod.on .ax-switch { background: var(--accent); }
.orgw-mod.on .ax-switch::after { left: 21px; }
.orgw-admin-card { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.orgw-admin-card b { display: block; }
.orgw-admin-card small { display: block; color: var(--text-secondary); }
@media (max-width: 760px) { .orgw-mods { grid-template-columns: 1fr; } }

.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; }

/* ── Organization page (Platform) ─────────────────────────────── */
.orgp-link { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--text-primary); cursor: pointer; text-align: left; display: inline-flex; align-items: center; gap: 6px; }
.orgp-link:hover, .orgp-link:focus-visible { color: var(--accent); text-decoration: underline; }
.orgp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.orgp-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.orgp-id h2 { margin: 0; font-size: 20px; }
.orgp-ic { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; background: var(--accent-light); font-size: 20px; flex: none; }
.orgp-sub { display: flex; align-items: center; gap: 10px; margin-top: 4px; font-size: 12.5px; color: var(--text-secondary); }
.orgp-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.orgp-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.orgp-tile { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; background: var(--bg-card); }
.orgp-tile i { grid-row: span 2; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: var(--accent-light); color: var(--accent); }
.orgp-tile b { font-size: 18px; line-height: 1.1; }
.orgp-tile span { font-size: 11.5px; color: var(--text-secondary); }
.orgp-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; }
.orgp-kv { display: grid; gap: 6px; margin: 0 0 8px; }
.orgp-kv > div { display: grid; grid-template-columns: 120px 1fr; gap: 8px; font-size: 13px; }
.orgp-kv dt { color: var(--text-muted); }
.orgp-kv dd { margin: 0; overflow-wrap: anywhere; }
.orgp-off { opacity: .5; }
.orgp-table td, .orgp-table th { font-size: 13px; }
.orgp-people { max-height: 340px; overflow: auto; }
.orgp-email a { color: var(--text-secondary); text-decoration: none; white-space: nowrap; }
.orgp-email a:hover { color: var(--accent); text-decoration: underline; }
.orgd-head .modal-title { color: #b91c1c; }
.orgd-list { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 3px; font-size: 13.5px; }
@media (max-width: 760px) { .orgp-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .orgp-grid { grid-template-columns: 1fr; } }
