.card{border-radius:1rem; overflow:hidden}
.btn{border-radius:.75rem}
.label-box{border:1px dashed #ddd; padding:4px}

/* Sidebar */
.sidebar-sticky{position:sticky; top:0; height:100vh; overflow:auto}
.sidebar .nav-link{color:#333; border-radius:.5rem; margin:.125rem 0}
.sidebar .nav-link.active, .sidebar .nav-link:hover{background:#e9f2ff; color:#0d6efd}
.sidebar .collapse .nav-link{padding-left:1rem}

/* Navbar */
/* Keep primary buttons white text, but make outline buttons visible on white bg */
.navbar .btn.btn-primary{color:#fff}
.navbar .btn.btn-outline-secondary{color:#495057; border-color:#ced4da}
.navbar .btn.btn-outline-secondary:hover{background:rgba(13,110,253,.08); color:#0d6efd; border-color:#0d6efd}
.navbar .search-input{background:#f6f8fb; border-color:#e7edf6}
.navbar{border-bottom:1px solid #eef2f7}
.card-header{border-bottom:1px solid #e9ecef}
.card{border:1px solid #e9ecef}
.navbar-sticky{position:sticky; top:0; z-index:1030}
.subnav-sticky{position:sticky; top:56px; z-index:1029}
.subnav .nav-link{border-radius:.5rem}

/* Dashboard metric cards */
.metric-card .icon{width:40px; height:40px; border-radius:10px; display:inline-flex; align-items:center; justify-content:center; color:#fff}
.metric-card.primary .icon{background:#0d6efd}
.metric-card.success .icon{background:#198754}
.metric-card.warning .icon{background:#ffc107; color:#222}
.metric-card.danger .icon{background:#dc3545}
.metric-card .value{font-size:1.75rem; font-weight:700}
.metric-card a{color:inherit; text-decoration:none}

/* Multiselect dropdown stacking above dashboard cards */
.multisel{position:relative}
.multisel .card{position:absolute; top:calc(100% + 4px); left:0; z-index:2000}

/* Mobile tweaks: collapse sidebar height and keep content near top */
@media (max-width: 767.98px){
	.sidebar-sticky{position:static; height:auto; overflow:visible}
	.sidebar-sticky .collapse{margin-bottom:0}
	.sidebar-sticky{border-right:0 !important}
	.sidebar-sticky > #sidebarMenu{
		position:fixed;
		top:var(--mobile-menu-top,112px);
		left:12px;
		right:12px;
		z-index:1040;
		max-height:calc(100vh - var(--mobile-menu-top,112px) - 12px);
		max-height:calc(100dvh - var(--mobile-menu-top,112px) - 12px);
		overflow-y:auto;
		overscroll-behavior:contain;
		background:#fff;
		border:1px solid #e9ecef;
		border-radius:1rem;
		box-shadow:0 .75rem 2rem rgba(15,23,42,.2);
		padding:0 .75rem;
	}
	.mobile-menu-toolbar{position:sticky; top:0; z-index:1; background:#fff; padding:.5rem 0; border-bottom:1px solid #e9ecef}
}

/* Thumbnails */
.logo-thumb{width:120px; height:120px; border:1px solid #e5e7eb; border-radius:.5rem; background:#f8fafc; display:inline-flex; align-items:center; justify-content:center; overflow:hidden}
.logo-thumb img{max-width:100%; max-height:100%; object-fit:contain}
.event-dashboard-header{display:flex; justify-content:space-between; align-items:flex-start; gap:1rem; flex-wrap:wrap}
.event-dashboard-actions{display:flex; gap:.5rem; flex-wrap:wrap; justify-content:flex-end}
.event-dashboard-logo{width:150px; min-width:150px; max-width:150px; height:150px; border:1px solid #e5e7eb; border-radius:1rem; background:#fff; box-shadow:0 .5rem 1.25rem rgba(15,23,42,.08); display:flex; align-items:center; justify-content:center; padding:.75rem; overflow:hidden}
.event-dashboard-logo img{display:block; width:100%; height:100%; max-width:120px; max-height:120px; object-fit:contain}

.event-kind-tabs{display:flex; flex-wrap:wrap; gap:.5rem; border:0; margin-bottom:1rem}
.event-kind-tabs .nav-link{border:1px solid #e7edf6; border-radius:.75rem; color:#495057; font-weight:600; background:#fff}
.event-kind-tabs .nav-link.active{background:#0d6efd; color:#fff; border-color:#0d6efd}
.event-form .event-section{background:#fff; border:1px solid #e9ecef; border-radius:1rem; padding:1rem 1.1rem 1.15rem}
.event-form .event-section-title{display:flex; align-items:center; gap:.5rem; margin:0 0 1rem; padding-bottom:.65rem; border-bottom:1px solid #eef2f7; font-size:.95rem; font-weight:700}
.event-form .event-section-title i{color:#0d6efd}
.event-choice-grid{display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:.75rem}
.event-choice{display:flex; align-items:flex-start; gap:.65rem; margin:0; padding:.75rem .85rem; border:1px solid #e7edf6; border-radius:.75rem; background:#fff; cursor:pointer; min-height:100%}
.event-choice .form-check-input{margin-top:.2rem; flex-shrink:0}
.event-panel{background:#f8fafc; border:1px solid #e7edf6; border-radius:.85rem; padding:1rem}
.event-actions{display:flex; flex-wrap:wrap; gap:.5rem; align-items:center}
.session-card{border:1px solid #e7edf6; border-radius:.85rem; padding:.85rem; background:#f8fafc}
.session-card .session-main{background:#fff; border-radius:.75rem}

/* Shared layouts must shrink within the sidebar/content grid. */
main.col{min-width:0}
main h3, main h4, .breadcrumb{overflow-wrap:anywhere}
.page-header{display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:1rem}
.page-header > .d-flex{flex-wrap:wrap; gap:.5rem}
.metric-card .icon{flex-shrink:0}
.metric-card .card-body > div, .event-dashboard-header > div{min-width:0}
.table-responsive{max-width:100%; overscroll-behavior-x:contain}
.mobile-record-list{display:grid; gap:1rem}
.mobile-record{overflow-wrap:anywhere}
.record-facts{display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.75rem; margin: .5rem 0 1rem}
.record-facts dt{font-size:.875rem; color:#6c757d; font-weight:500}
.record-facts dd{margin:0}
.record-actions{display:flex; flex-wrap:wrap; gap:.5rem}
.record-actions .btn{white-space:normal}
.record-more summary{cursor:pointer; padding:.5rem 0; font-weight:600; min-height:44px}
.record-more summary:focus-visible{outline:2px solid #0d6efd; outline-offset:3px}
.mobile-qr-grid{display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr)); gap:1rem}
.member-profile td{overflow-wrap:anywhere}
.member-profile table{table-layout:fixed; width:100%}

@media (max-width: 991.98px){
  /* List tables become labelled records while retaining their original controls. */
  .responsive-records{display:block; border:0; margin:0; width:100%}
  .responsive-records > thead{position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0}
  .responsive-records > tbody{display:grid; gap:1rem; width:100%}
  .responsive-records > tbody > tr{display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.75rem; padding:1rem; border:1px solid #e9ecef; border-radius:1rem; background:#fff}
  .responsive-records > tbody > tr > td{display:block; min-width:0; width:auto !important; padding:0; border:0; background:transparent; box-shadow:none; text-align:left !important; overflow-wrap:anywhere}
  .responsive-records > tbody > tr > td::before{content:attr(data-label); display:block; margin-bottom:.25rem; font-size:.875rem; font-weight:500; color:#6c757d}
  .responsive-records > tbody > tr > td[data-label=""]::before{display:none}
  .responsive-records > tbody > tr > .record-field-wide{grid-column:1 / -1}
  .responsive-records .btn-group, .responsive-records .d-inline-flex{display:flex; flex-wrap:wrap; justify-content:flex-start !important; gap:.5rem}
  .responsive-records .btn{min-height:44px; white-space:normal}
  .responsive-records form.d-flex{flex-wrap:wrap; gap:.5rem}
  .responsive-records input:not([type="checkbox"]):not([type="radio"]), .responsive-records select{max-width:100%; min-width:0}
  .responsive-records td > div{max-width:100%}
  .responsive-records .form-control, .responsive-records .form-select{width:100% !important; margin-bottom:.5rem}
  .responsive-records input[type="checkbox"]{width:24px; height:24px}
  .page-header{align-items:flex-start}
  .record-actions .btn{min-height:44px; display:inline-flex; align-items:center; justify-content:center}
  .table-responsive .table-row-form{min-width:220px; flex-direction:column; align-items:stretch !important}
  .table-row-form .form-control, .table-row-form .form-select{width:100% !important; min-width:0}
}
@media (max-width: 767.98px){
  .page-header{flex-direction:column; gap:.75rem}
  .event-dashboard-actions{justify-content:flex-start}
  .btn, .navbar .btn.btn-sm{min-height:44px; display:inline-flex; align-items:center; justify-content:center}
  .btn{white-space:normal}
  .form-control, .form-select{min-height:44px; font-size:1rem}
  .navbar .btn-group .btn{padding-left:.5rem !important; padding-right:.5rem !important}
  .navbar > .container-fluid{gap:.5rem}
  .navbar-brand{margin-right:0; max-width:100%}
  .navbar-brand img{max-width:100%; object-fit:contain}
  .navbar .ms-auto{flex-wrap:wrap}
  .sidebar .nav-link{min-height:44px}
  .multisel .form-check{min-height:44px; padding-top:.5rem; padding-bottom:.5rem}
  .multisel .form-check-label{display:block; overflow-wrap:anywhere}
  .multisel > button{white-space:normal; overflow-wrap:anywhere}
  .member-profile table, .member-profile tbody, .member-profile tr, .member-profile th, .member-profile td{display:block; width:100% !important}
  .member-profile th{border-bottom:0; padding-bottom:0; color:#6c757d; font-weight:500}
  .member-profile td{padding-top:.25rem}
}
