/* ==========================================================================
   BORDERLINE · OBSIDIAN RED
   CRM, client record drawer, plans, prices, QR Centre.
   ========================================================================== */

/* --------------------------------------------------------------------------
   CRM
   -------------------------------------------------------------------------- */
#crmSection { min-width: 0; margin: 0; padding: 0; background: transparent; border: 0; border-radius: 0; box-shadow: none; }

.crm-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.crm-head .back-btn { flex: none; width: 32px; height: 32px; min-height: 32px; margin-top: 3px; padding: 0; border: 1px solid var(--border); background: transparent; color: var(--muted); }
.crm-head .back-btn:hover { background: var(--surface-2); color: var(--text); }
.crm-head-copy { min-width: 0; flex: 1; }
.crm-head h1 { margin: 0 0 4px; font-size: clamp(26px, 2.3vw, 34px); }
.crm-head p { margin: 0; color: var(--muted); font-size: 11.5px; }
.crm-head-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.crm-head-actions button { min-height: 32px; font-size: 11.5px; }
.crm-plan-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0; }
.crm-plan-actions > span { display: none; }

/* Filters — an open strip, not a card */
.crm-filters {
  display: grid;
  grid-template-columns: minmax(200px, 1.6fr) repeat(3, minmax(130px, .8fr));
  gap: 14px;
  margin: 0 0 22px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: transparent;
}
.crm-filter { min-width: 0; }
.crm-filter label { margin-bottom: 5px; font-size: 9.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted-2); }
.crm-filter select { min-height: 34px; font-size: 11.5px; }
.crm-filter--search .input-icon { position: relative; }
.crm-filter--search .input-icon svg { position: absolute; left: 10px; top: 50%; width: 13px; height: 13px; transform: translateY(-50%); color: var(--muted-2); pointer-events: none; }
#crmSection .crm-filter--search input { padding-left: 31px; min-height: 34px; font-size: 11.5px; }

.crm-directory-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 0 0 8px; }
.crm-directory-heading h3 { margin: 0; font-size: 15px; }
.crm-directory-heading .directory-meta { color: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.crm-table-hint { margin: 0 0 8px; color: var(--muted-2); font-size: 10px; line-height: 1.5; }

/* Table — open, precise */
.crm-table-scroll {
  position: relative;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: transparent;
}
.crm-table-scroll:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
#crmSection .crm-table-scroll table { width: 100%; min-width: 840px; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
#crmSection .crm-table-scroll th {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 9px 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
}
#crmSection .crm-table-scroll th:last-child,
#crmSection .crm-table-scroll td:last-child { text-align: right; }
#crmSection .crm-table-scroll td {
  height: var(--row-h);
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-2);
  font-size: 12px;
  vertical-align: middle;
}
#crmSection .crm-table-scroll tbody tr:last-child td { border-bottom: 0; }
#crmSection .crm-table-scroll tbody tr { transition: background-color var(--dur-1) linear; }
#crmSection .crm-table-scroll tbody tr:hover { background: var(--surface-inset); }
#crmSection .crm-table-scroll tbody tr[role="button"] { cursor: pointer; }
#crmSection .crm-table-scroll tbody tr[role="button"]:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
#crmSection .crm-table-scroll td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--bg);
  color: var(--text);
  font-weight: 500;
  box-shadow: 1px 0 0 var(--border-soft);
}
#crmSection .crm-table-scroll thead th:first-child { left: 0; z-index: 4; background: var(--bg); }
#crmSection .crm-table-scroll tbody tr:hover td:first-child { background: var(--surface-inset); }
#crmSection .crm-table-scroll td.crm-name-cell { min-width: 190px; }
#crmSection .crm-table-scroll tbody tr.is-selected,
#crmSection .crm-table-scroll tbody tr.is-selected:hover { background: var(--primary-softer); }
#crmSection .crm-table-scroll tbody tr.is-selected td:first-child { background: var(--primary-softer); box-shadow: inset 2px 0 0 var(--primary); }
#crmSection .crm-table-scroll tbody tr.is-selected td { color: var(--text); }
.crm-client-id { display: block; margin-top: 2px; color: var(--muted-2); font-size: 9px; font-weight: 400; }
#crmSection .crm-empty { height: auto !important; padding: 28px 14px !important; text-align: left !important; color: var(--muted) !important; font-size: 11.5px; line-height: 1.6; }
#crmSection .crm-empty::before { content: ""; display: block; width: 20px; height: 20px; margin: 0 0 9px; border: 1px solid var(--border-strong); border-radius: 2px; background: linear-gradient(var(--muted-2), var(--muted-2)) center/8px 1px no-repeat, linear-gradient(var(--muted-2), var(--muted-2)) center/1px 8px no-repeat; opacity: .6; }

/* Table footer / pagination */
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 9px 0 0; }
.table-foot__range { color: var(--muted-2); font-size: 10px; font-variant-numeric: tabular-nums; }
.pager { display: flex; align-items: center; gap: 3px; }
.pager button { min-width: 27px; min-height: 27px; padding: 0 7px; border: 1px solid var(--border); border-radius: 3px; background: transparent; color: var(--muted); font-size: 10px; box-shadow: none; }
.pager button:hover:not(:disabled) { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }
.pager button[aria-current="true"] { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }
.pager button:disabled { opacity: .3; }
.pager__info { padding: 0 6px; color: var(--muted-2); font-size: 10px; font-variant-numeric: tabular-nums; }
.crm-list-feedback { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.crm-list-feedback p { margin: 3px 0; flex: 1 1 220px; color: var(--muted-2); font-size: 10px; }
.crm-list-feedback button { min-height: 28px; font-size: 10px; }

/* --------------------------------------------------------------------------
   Client record — right drawer
   -------------------------------------------------------------------------- */
.crm-drawer-scrim {
  position: fixed;
  top: var(--demo-banner-h, 0px);
  left: 0; right: 0; bottom: 0;
  z-index: 8400;
  background: rgba(0, 0, 0, .62);
  animation: bl-scrim-in 220ms linear both;
}
[data-theme="light"] .crm-drawer-scrim { background: rgba(36, 36, 36, .3); }
@keyframes bl-scrim-in { from { opacity: 0; } to { opacity: 1; } }
body.drawer-locked { overflow: hidden; }

#crmClientCard {
  position: fixed;
  top: var(--demo-banner-h, 0px);
  right: 0;
  bottom: 0;
  z-index: 8500;
  width: min(560px, 100vw);
  margin: 0;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  border: 0;
  border-left: 1px solid var(--border-strong);
  border-radius: 0;
  box-shadow: -20px 0 70px -30px rgba(0, 0, 0, .85);
  animation: bl-drawer-in 280ms var(--ease-drawer) both;
}
@keyframes bl-drawer-in { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
#crmClientCard.hidden { display: none !important; }
.client-card-head {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.client-card-head h3 { margin: 0 0 3px; font-size: 22px; letter-spacing: -.035em; }
.client-card-head p { margin: 0; color: var(--muted); font-size: 10.5px; }
.client-card-head .drawer-close {
  flex: none;
  width: 30px; height: 30px; min-height: 30px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}
.client-card-head .drawer-close:hover { background: var(--surface-2); color: var(--text); }
.client-card-body { padding: 20px 22px 26px; }

#crmClientDetails { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; border-top: 1px solid var(--border); margin-bottom: 16px; }
#crmClientDetails p { margin: 0; padding: 11px 0; min-width: 0; border-bottom: 1px solid var(--border-soft); overflow-wrap: anywhere; }
#crmClientDetails strong { display: block; margin-bottom: 3px; color: var(--muted-2); font-size: 8.5px; font-weight: 600; letter-spacing: .11em; text-transform: uppercase; }
#crmClientDetails span { color: var(--text); font-size: 12.5px; font-weight: 450; font-variant-numeric: tabular-nums; }

#crmEditActions { display: flex; gap: 8px; }
#crmEditActions button { min-height: 30px; font-size: 11px; }
#crmEditForm { margin-top: 16px; padding: 16px 0 0; border: 0; border-top: 1px solid var(--border); background: transparent; }
#crmEditForm input { max-width: none; }
#crmEditForm > div { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

#membershipManager { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
#membershipManager > h4, #crmClientCard > h4, .client-card-body > h4 { margin: 0 0 4px; font-size: 13px; }
#membershipStatus { margin: 0 0 12px; font-size: 10.5px; }
#membershipActivationPanel { margin: 12px 0; padding: 12px 13px; border: 1px solid var(--warning-line); border-radius: 2px; background: var(--warning-soft); }
#membershipActivationInfo { margin: 0 0 8px; color: var(--warning) !important; font-size: 10.5px; }
#membershipActivateBtn { min-height: 32px; font-size: 11px; }
#membershipActivationStatus { margin: 7px 0 0; font-size: 10px; }
#membershipOpenBtn { min-height: 32px; font-size: 11px; }
#membershipCreateForm { margin-top: 14px; padding: 16px 0 0; border: 0; border-top: 1px solid var(--border); background: transparent; animation: bl-panel-in 220ms var(--ease-out) both; }
@keyframes bl-panel-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
#membershipCreateForm .form-grid { margin-bottom: 2px; }
#membershipCreateForm input[type="date"] { min-height: 40px; }
#membershipCreateForm .note { margin: 13px 0 0; padding: 9px 10px; border: 0; border-radius: 2px; background: var(--surface-inset); color: var(--muted); font-size: 10.5px; line-height: 1.55; }

#crmQRPanel { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
#crmQRPanel .actions { display: flex; gap: 7px; flex-wrap: wrap; margin: 10px 0; }
#crmQRPanel button { min-height: 30px; font-size: 10.5px; }
#crmSaveQRBtn { margin-bottom: 10px; }
#crmOpenQRCenterBtn { margin-top: 18px; min-height: 30px; font-size: 10.5px; }

.visits-block { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
.visits-block h4 { margin: 0 0 4px; font-size: 13px; }
#crmVisitsStatus { margin: 0 0 8px; color: var(--muted); font-size: 10.5px; }
#crmVisitsBody td { padding: 8px 10px !important; border-bottom: 1px solid var(--border-soft) !important; font-size: 11px; }
.visits-block table { min-width: 480px; }
.visits-block .scroll-x { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.visits-block th { padding: 7px 10px; border-bottom: 1px solid var(--border); font-size: 8.5px; }

/* --------------------------------------------------------------------------
   Plans — ledger rows
   -------------------------------------------------------------------------- */
#crmPlansSection { margin: 30px 0 0; padding: 18px 0 0; border: 0; border-top: 1px solid var(--border); background: transparent; border-radius: 0; }
#crmPlansSection > h3 { margin: 0 0 3px; font-size: 15px; }
#crmPlansSection > .muted { margin: 0 0 12px; font-size: 10.5px; }
#crmPlansList { display: grid; }
#crmPlansList > h4 { margin: 16px 0 4px; color: var(--muted-2); font-size: 8.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
#crmPlansList > h4:first-child { margin-top: 0; }
#crmPlansList > p { margin: 0; padding: 16px 0; border-bottom: 1px solid var(--border-soft); color: var(--muted); font-size: 11px; }
#crmPlansList > div {
  display: grid;
  grid-template-columns: minmax(150px, 1.1fr) 96px minmax(160px, 1.3fr) auto;
  align-items: center;
  gap: 16px;
  padding: 11px 0 !important;
  border: 0 !important;
  border-bottom: 1px solid var(--border-soft) !important;
  border-radius: 0;
  background: transparent;
  transition: background-color var(--dur-1) linear;
}
#crmPlansList > div:hover { background: var(--surface-inset); }
#crmPlansList > div > strong { color: var(--text); font-size: 11.5px; font-weight: 500; letter-spacing: -.005em; overflow-wrap: anywhere; }
#crmPlansList > div > div { margin: 0 !important; color: var(--text); font-family: var(--font-display); font-size: 15px !important; font-weight: 600 !important; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; text-align: right; }
#crmPlansList > div > p { margin: 0 !important; color: var(--muted) !important; font-size: 10px !important; line-height: 1.5; }
#crmPlansList > div > button { margin: 0 !important; min-height: 26px; padding: 0 8px !important; font-size: 9.5px; }
#crmPlansStatus { margin: 10px 0 0; font-size: 10px; }

/* --------------------------------------------------------------------------
   Form sheets
   -------------------------------------------------------------------------- */
#crmAddClientPanel, #crmNewPlanPanel, #crmClubPricesPanel {
  margin: 16px 0;
  padding: 18px 0 !important;
  border: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  animation: bl-panel-in 240ms var(--ease-out) both;
  scroll-margin-top: calc(var(--topbar-h) + var(--demo-banner-h, 0px) + 16px);
}
#crmAddClientPanel > h3, #crmNewPlanPanel > h3, #crmClubPricesPanel > h3 { margin: 0 0 3px; font-size: 15px; }
#crmAddClientPanel .panel-sub, #crmNewPlanPanel .panel-sub, #crmClubPricesPanel .panel-sub { margin: 0 0 15px; color: var(--muted); font-size: 10.5px; }
#crmAddClientForm, #crmNewPlanForm { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; align-items: start; }
#crmAddClientForm .field, #crmNewPlanForm .field { min-width: 0; }
#crmNewPlanForm .field--full { grid-column: 1 / -1; }
#crmNewPlanForm #crmPlanLimitWrap { display: grid; }
#crmNewPlanForm .form-actions, #crmAddClientForm .form-actions { grid-column: 1 / -1; }
#crmNewPlanForm textarea { min-height: 74px; }
#crmNewPlanForm .actions, #crmAddClientForm .actions { display: flex; gap: 8px; margin-top: 0; }
#crmPlanPriceStatus, #crmPlanFormStatus, #crmCreateStatus, #crmPlanFormStatus { margin: 0; font-size: 10.5px; grid-column: 1 / -1; }
#crmClubPricesPanel > label { margin-top: 10px; }
#crmClubPricesPanel > select { max-width: 300px; margin-bottom: 4px !important; }
#crmClubPricesList { display: grid; margin-top: 8px; }
#crmClubPricesList > div { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 10px 0 !important; border: 0 !important; border-bottom: 1px solid var(--border-soft) !important; border-radius: 0; background: transparent; }
#crmClubPricesList > div > strong { color: var(--text-2); font-size: 11px; font-weight: 450; min-width: 150px; }
#crmClubPricesList > div > div { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin: 0 !important; }
#crmClubPricesList input { width: 150px !important; min-height: 30px; padding: 6px 8px !important; }
#crmClubPricesList span { color: var(--muted); font-size: 10px; }
#crmClubPricesList button { min-height: 28px; font-size: 10px; }
#crmClubPricesStatus { margin: 10px 0 0; font-size: 10.5px; }

/* --------------------------------------------------------------------------
   QR Centre
   -------------------------------------------------------------------------- */
#manageMode { min-width: 0; }
#manageMode .manage-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
#manageMode .manage-head-copy { flex: 1; min-width: 0; }
#manageMode .manage-head h1 { margin: 0 0 4px; font-size: clamp(26px, 2.3vw, 34px); }
#manageMode .manage-head p { margin: 0; color: var(--muted); font-size: 11.5px; max-width: 66ch; }
#manageMode .manage-head-actions { display: flex; gap: 6px; flex-wrap: wrap; }
#manageMode .manage-head-actions button { min-height: 32px; font-size: 11.5px; }
.qr-search-bar { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 0; padding: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: transparent; }
.qr-search-bar .field { flex: 1 1 260px; }
.qr-search-bar .field label { font-size: 9.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted-2); }
.qr-search-bar .input-icon { position: relative; }
.qr-search-bar .input-icon svg { position: absolute; left: 10px; top: 50%; width: 13px; height: 13px; transform: translateY(-50%); color: var(--muted-2); pointer-events: none; }
#manageMode .qr-search-bar input { padding-left: 31px; min-height: 34px; font-size: 11.5px; }
#clientsLoadStatus { flex: 1 1 100%; margin: 0; color: var(--muted-2); font-size: 10px; }
.manage-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr); border-bottom: 1px solid var(--border); }
#issueQrSection, #rightsTest { min-width: 0; padding: 24px 0 26px; border: 0; border-radius: 0; background: transparent; }
#issueQrSection { padding-right: 26px; border-right: 1px solid var(--border); }
#rightsTest { padding-left: 26px; }
#issueQrSection h2, #rightsTest h2 { margin: 0 0 4px; font-size: 16px; }
#issueQrSection > p, #rightsTest > p { margin: 0 0 14px; color: var(--muted); font-size: 10.5px; line-height: 1.6; }
#issueQrSection .actions, #rightsTest .actions { display: flex; gap: 7px; flex-wrap: wrap; margin: 13px 0 0; }
#issueQrSection .actions button, #rightsTest .actions button { min-height: 32px; font-size: 10.5px; }
.test-result { margin: 11px 0 0; padding: 9px 0 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: transparent; color: var(--muted); font-size: 10.5px; line-height: 1.55; min-height: 30px; overflow-wrap: anywhere; }
.test-result:empty { display: none; }
#issuedQr { margin-top: 14px; padding: 16px; border: 1px solid #d8d5cf; border-radius: 2px; background: #ffffff; color: #1b1b1b; text-align: center; }
#qrCanvas { display: inline-flex; justify-content: center; align-items: center; padding: 8px; background: #fff; border-radius: 0; cursor: zoom-in; }
#qrCanvas img, #qrCanvas canvas, #crmQRImage img, #crmQRImage canvas { display: block; width: 100%; max-width: 232px; height: auto; }
#saveQrBtn { margin-top: 11px; min-height: 30px; font-size: 10.5px; background: #f0eeea; border-color: #c9c6c0; color: #1b1b1b; }
#saveQrBtn:hover { background: #e6e3dd; border-color: #b9b5ae; color: #1b1b1b; }
#savedQrArea { margin-top: 18px; padding-top: 13px; border-top: 1px solid var(--border); }
#savedQrArea > p { margin: 0 0 9px; font-size: 10px; line-height: 1.6; }
#savedQrFile { max-width: 100%; font-size: 10.5px; }
#savedQrPreview { margin-top: 11px; }
#savedQrPreview img { display: block; width: min(100%, 200px); height: auto; margin: 9px auto; border: 8px solid #fff; border-radius: 0; }
#savedQrPreview p { margin: 7px 0 0; font-size: 9.5px; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .crm-filters { grid-template-columns: 1fr 1fr; }
  .crm-filter--search { grid-column: 1 / -1; }
  .manage-grid { grid-template-columns: 1fr; }
  #issueQrSection { border-right: 0; padding-right: 0; }
  #rightsTest { padding-left: 0; border-top: 1px solid var(--border); }
  #crmPlansList > div { grid-template-columns: minmax(140px, 1fr) 90px minmax(140px, 1fr) auto; gap: 12px; }
}
@media (max-width: 760px) {
  .crm-head { flex-wrap: wrap; }
  .crm-head-copy { flex: 1 1 180px; }
  .crm-head-actions { width: 100%; justify-content: flex-start; }
  .crm-head-actions button { flex: 1 1 auto; }
  .crm-filters { grid-template-columns: 1fr; padding: 10px 0; gap: 10px; }
  .crm-filter--search { grid-column: auto; }
  .crm-directory-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  #crmSection .crm-table-scroll th { padding: 8px 10px; }
  #crmSection .crm-table-scroll td { padding: 8px 10px; }
  #crmClientCard { width: 100vw; border-left: 0; }
  .client-card-head { padding: 16px; }
  .client-card-body { padding: 16px; }
  #crmClientDetails { grid-template-columns: 1fr 1fr; column-gap: 14px; }
  #crmPlansList > div { grid-template-columns: 1fr auto; gap: 6px 12px; padding: 10px 0 !important; }
  #crmPlansList > div > p { grid-column: 1 / -1; }
  #crmPlansList > div > button { grid-column: 2; grid-row: 1; align-self: start; }
  #crmPlansList > div > div { grid-column: 2; grid-row: 2; text-align: right; }
  #crmAddClientForm, #crmNewPlanForm { grid-template-columns: 1fr; }
  .manage-head { flex-wrap: wrap; }
  #manageMode .manage-head-actions { width: 100%; }
  .table-foot { align-items: flex-start; }
}
@media (max-width: 420px) {
  #crmClientDetails { grid-template-columns: 1fr; }
  .crm-head-actions { gap: 6px; }
  .crm-head-actions .crm-plan-actions { flex: 1 1 100%; }
  .crm-head-actions .crm-plan-actions button { flex: 1 1 0; min-width: 0; }
  .crm-head-actions #crmAddClientBtn { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  #crmClientCard, #membershipCreateForm, #crmAddClientPanel, #crmNewPlanPanel, #crmClubPricesPanel, #issuedQr, .crm-drawer-scrim { animation: none; }
}
@media (hover: hover) and (pointer: fine) {
  #crmSection .crm-table-scroll tbody tr[role="button"]:hover td:first-child { box-shadow: 1px 0 0 var(--border-soft), inset 2px 0 0 transparent; }
  #crmSection .crm-table-scroll tbody tr.is-selected:hover td:first-child { box-shadow: inset 2px 0 0 var(--primary); }
}


#membershipPlanPreviewStatus { margin: 5px 0 0; }


/* ==========================================================================
   OBSIDIAN EMBER — CRM life
   ========================================================================== */

.crm-head .back-btn { transition: transform 200ms var(--ease-spring), background-color 120ms linear, color 120ms linear; }
.crm-head .back-btn:hover { transform: translateX(-2px); }
.crm-head h1 { transition: color 160ms linear; }

#crmClientCard:not(.hidden) { animation: bl-drawer-in 340ms var(--ease-spring) both; }
@keyframes bl-drawer-in {
  from { transform: translateX(30px) scale(.995); opacity: .45; }
  to { transform: none; opacity: 1; }
}
.client-card-head .drawer-close { transition: transform 240ms var(--ease-spring), background-color 120ms linear, color 120ms linear; }
.client-card-head .drawer-close:hover { transform: rotate(90deg); }
#crmClientCard:not(.hidden) .client-card-body > * {
  animation: bl-drawer-item 400ms var(--ease-spring) both;
}
#crmClientCard:not(.hidden) .client-card-body > *:nth-child(1) { animation-delay: 30ms; }
#crmClientCard:not(.hidden) .client-card-body > *:nth-child(2) { animation-delay: 60ms; }
#crmClientCard:not(.hidden) .client-card-body > *:nth-child(3) { animation-delay: 90ms; }
#crmClientCard:not(.hidden) .client-card-body > *:nth-child(4) { animation-delay: 120ms; }
#crmClientCard:not(.hidden) .client-card-body > *:nth-child(5) { animation-delay: 150ms; }
#crmClientCard:not(.hidden) .client-card-body > *:nth-child(6) { animation-delay: 180ms; }
#crmClientCard:not(.hidden) .client-card-body > *:nth-child(7) { animation-delay: 210ms; }
@keyframes bl-drawer-item {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

#crmPlansList > div { transition: background-color 140ms linear, transform 220ms var(--ease-spring); }
#crmPlansList > div:hover { transform: translateX(4px); }
#crmPlansList > div > button { transition: transform 180ms var(--ease-spring), background-color 120ms linear, border-color 120ms linear; }
#crmPlansList > div:hover > button { transform: translateX(-2px); }
#crmClubPricesList > div { transition: background-color 140ms linear, transform 200ms var(--ease-spring); }
#crmClubPricesList > div:hover { background: var(--surface-inset); transform: translateX(3px); }
#crmClubPricesList button { transition: transform 180ms var(--ease-spring), background-color 120ms linear, border-color 120ms linear; }
#crmClubPricesList button:hover:not(:disabled) { transform: translateY(-1px); }

#issueQrSection .actions button,
#rightsTest .actions button { transition: transform 180ms var(--ease-spring), background-color 120ms linear, border-color 120ms linear; }
#issueQrSection .actions button:hover:not(:disabled),
#rightsTest .actions button:hover:not(:disabled) { transform: translateY(-1px); }
#issuedQr { animation: bl-qr-pop 360ms var(--ease-spring) both; }
@keyframes bl-qr-pop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }

.pager button { transition: transform 160ms var(--ease-spring), background-color 110ms linear, border-color 110ms linear; }
.pager button:hover:not(:disabled) { transform: translateY(-1px); }
#crmStatus, #crmPlansStatus, #crmClubPricesStatus { transition: color 140ms linear; }

@media (prefers-reduced-motion: reduce) {
  #crmClientCard:not(.hidden),
  #crmClientCard:not(.hidden) .client-card-body > *,
  #issuedQr, .crm-head .back-btn, .client-card-head .drawer-close,
  #crmPlansList > div, #crmClubPricesList > div, .pager button { animation: none !important; transition: none !important; transform: none !important; }
}
[data-motion="reduce"] #crmClientCard:not(.hidden),
[data-motion="reduce"] #crmClientCard:not(.hidden) .client-card-body > *,
[data-motion="reduce"] #issuedQr,
[data-motion="reduce"] .crm-head .back-btn,
[data-motion="reduce"] .client-card-head .drawer-close,
[data-motion="reduce"] #crmPlansList > div,
[data-motion="reduce"] #crmClubPricesList > div,
[data-motion="reduce"] .pager button { animation: none !important; transition: none !important; transform: none !important; }

/* Client drawer: extra room below the last block so the visit history is not hidden behind the OS taskbar */
#crmClientCard { height: auto; max-height: calc(100dvh - var(--demo-banner-h, 0px)); scroll-padding-bottom: 140px; }
.client-card-body { padding-bottom: calc(26px + 140px + env(safe-area-inset-bottom, 0px)); }
