/* ==========================================================================
   BGZ dashboard (Filament panel) — layout and building blocks for the
   custom master/detail screens. Loaded after tokens.css + components.css.
   Filament's own .fi-* classes are only overridden in the first block.
   ========================================================================== */

/* ── Filament overrides ── */
.fi-body { background-color: var(--bgz-bg); --topbar-height: var(--bgz-nav-height); }

/* Top band = public site header: navy, club logo, white icons */
.fi-topbar, .fi-sidebar-header { background-color: var(--bgz-navy); box-shadow: none; }
.fi-topbar .fi-logo, .fi-sidebar-header .fi-logo { margin: 0; }
.fi-topbar .fi-icon-btn, .fi-sidebar-header .fi-icon-btn { color: var(--bgz-on-navy-muted); }
.fi-topbar .fi-icon-btn:not(.fi-disabled):not([disabled]):hover,
.fi-sidebar-header .fi-icon-btn:not(.fi-disabled):not([disabled]):hover { color: var(--bgz-on-navy); background-color: var(--bgz-on-navy-hover); }
.fi-topbar .fi-user-avatar { width: var(--bgz-avatar-size); height: var(--bgz-avatar-size); }

/* Login page: logo on a light background */
.fi-simple-layout .bgz-logo { color: var(--bgz-navy); }
.fi-simple-layout .bgz-logo__img { filter: none; }
.fi-simple-layout .bgz-logo__accent { color: var(--bgz-primary); }

.bgz-topbar-link { margin-inline-end: var(--bgz-space-3); color: var(--bgz-on-navy-muted); font-size: var(--bgz-text-sm); font-weight: var(--bgz-weight-medium); text-decoration: none; white-space: nowrap; }
.bgz-topbar-link:hover { color: var(--bgz-on-navy); text-decoration: underline; }
@media (max-width: 640px) { .bgz-topbar-link { display: none; } }

/* ── Page toolbar (buttons above the table) ── */
.bgz-toolbar { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: var(--bgz-space-2); margin-bottom: var(--bgz-space-3); }

/* ── Master/detail layout ──
   Phone / no selection: stacked full width. Desktop with a selection: 40/60. */
.bgz-layout { display: flex; flex-direction: column; gap: var(--bgz-space-6); align-items: flex-start; }
.bgz-layout__master, .bgz-layout__detail { width: 100%; min-width: 0; }
@media (min-width: 1024px) {
    .bgz-layout--has-selection { flex-direction: row; }
    .bgz-layout--has-selection .bgz-layout__master { width: 40%; flex-shrink: 0; }
    .bgz-layout--has-selection .bgz-layout__detail { flex: 1; position: sticky; top: var(--bgz-space-4); }
}

.bgz-detail-actions { display: flex; flex-wrap: wrap; gap: var(--bgz-space-2); margin-top: var(--bgz-space-4); }
.bgz-detail-alert { margin-top: var(--bgz-space-3); }

/* Clickable table row: every cell carries the same wire:click (see HasClickableRows) */
.bgz-row-click { cursor: pointer; }

/* ── Read-only fields (detail panel) — <x-field label="…">value</x-field> ── */
.bgz-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--bgz-space-2); }
.bgz-field {
    padding: var(--bgz-space-2) var(--bgz-space-3);
    background: var(--bgz-surface-muted);
    border: 1px solid var(--bgz-border-subtle); border-radius: var(--bgz-radius-md);
}
.bgz-field--full { grid-column: 1 / -1; }
.bgz-field__label { display: block; margin-bottom: 2px; font-size: 0.68rem; font-weight: var(--bgz-weight-medium); letter-spacing: 0.04em; text-transform: uppercase; color: var(--bgz-text-muted); }
.bgz-field__value { display: block; font-size: var(--bgz-text-sm); color: var(--bgz-text); overflow-wrap: anywhere; white-space: pre-line; }
.bgz-field__value a { color: var(--bgz-primary); text-decoration: none; }
.bgz-field__value a:hover { text-decoration: underline; }
@media (max-width: 640px) {
    .bgz-fields { grid-template-columns: 1fr; }
}

/* ── Modal — native Livewire modal (see CLAUDE.md "Modal pattern") ── */
.bgz-modal-overlay {
    position: fixed; inset: 0; z-index: var(--bgz-z-modal);
    display: flex; align-items: center; justify-content: center;
    padding: var(--bgz-space-4);
    background: var(--bgz-overlay);
}
.bgz-modal {
    display: flex; flex-direction: column;
    width: 100%; max-width: 36rem; max-height: 90vh;
    background: var(--bgz-surface);
    border: 1px solid var(--bgz-border); border-radius: var(--bgz-radius-lg);
    box-shadow: var(--bgz-shadow-lg);
}
.bgz-modal--sm { max-width: 26rem; }
.bgz-modal__header { display: flex; align-items: center; justify-content: space-between; padding: var(--bgz-space-4) var(--bgz-space-6); border-bottom: 1px solid var(--bgz-border-subtle); }
.bgz-modal__title { margin: 0; font-family: var(--bgz-font-heading); font-size: var(--bgz-text-lg); font-weight: var(--bgz-weight-bold); color: var(--bgz-text); }
.bgz-modal__close { padding: var(--bgz-space-1) var(--bgz-space-2); background: none; border: none; border-radius: var(--bgz-radius-sm); color: var(--bgz-text-muted); font-size: var(--bgz-text-base); line-height: 1; cursor: pointer; }
.bgz-modal__close:hover { background: var(--bgz-surface-muted); color: var(--bgz-text); }
.bgz-modal__body { padding: var(--bgz-space-5) var(--bgz-space-6); overflow-y: auto; }
.bgz-modal__footer { display: flex; justify-content: flex-end; gap: var(--bgz-space-3); padding: var(--bgz-space-4) var(--bgz-space-6); border-top: 1px solid var(--bgz-border-subtle); }
@media (max-width: 640px) {
    .bgz-modal-overlay { padding: 0; align-items: stretch; }
    .bgz-modal { max-width: none; max-height: none; border-radius: 0; }
    .bgz-modal__header, .bgz-modal__body, .bgz-modal__footer { padding-left: var(--bgz-space-4); padding-right: var(--bgz-space-4); }
}

/* ── Chips: removable values in a modal (e.g. excluded dates) ── */
.bgz-chips { display: flex; flex-wrap: wrap; gap: var(--bgz-space-2); }
.bgz-chip { display: inline-flex; align-items: center; gap: var(--bgz-space-1); padding: var(--bgz-space-1) var(--bgz-space-1) var(--bgz-space-1) var(--bgz-space-3); background: var(--bgz-surface-muted); border: 1px solid var(--bgz-border); border-radius: var(--bgz-radius-full); font-size: var(--bgz-text-sm); color: var(--bgz-text); }
.bgz-chip__remove { padding: 0 var(--bgz-space-2); background: none; border: none; border-radius: var(--bgz-radius-full); color: var(--bgz-text-muted); line-height: 1.5; cursor: pointer; }
.bgz-chip__remove:hover { background: var(--bgz-danger-soft); color: var(--bgz-danger); }

/* ── Field + button on one line ── */
.bgz-inline-add { display: flex; gap: var(--bgz-space-2); align-items: flex-start; }
.bgz-inline-add__field { flex: 1; min-width: 0; }
