/* =========================
   CRM LAYOUT FOUNDATION
========================= */
html {
  height: -webkit-fill-available;
}

body {
  min-height: 100vh;
  min-height: -webkit-fill-available;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #000;
  color: #fff;
  margin: 0;
  overflow-x: hidden;
}

/* REMOVE FLEX FROM BODY */
.crm-body {
  background: #000;
  min-height: 100%;
}

/* MAIN AREA */
.crm-main {
  margin-left: 70px;
  min-height: auto; /* IMPORTANT */
  padding-bottom: 120px; /* space for floating button */
}

.mobile-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(3px);
  display: none;
  z-index: 9998;
}

.mobile-overlay.show{
  display:block;
}

/* =========================
   DESKTOP ONLY
========================= */

@media (min-width:1025px){
  .crm-body{
    display:flex;
  }

  .crm-main{
    flex:1;
  }
}

/* =========================
   MOBILE MODE
========================= */

@media (max-width:1024px){

  .crm-main{
    margin-left:0;
    padding-bottom:120px;
  }

}

/* ===== Dynamic Table Engine Base (minimal) ===== */
.qp-table-topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin: 6px 0 14px;
}
.qp-table-title{
  font-weight:900;
  letter-spacing:.2px;
  color:#fff;
}
.qp-table-controls{
  display:flex;
  gap:10px;
  align-items:center;
}
.qp-table-search{
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  color:#fff;
  padding:10px 12px;
  border-radius:12px;
  outline:none;
  min-width: 220px;
}
.qp-table-perpage{
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  color:#fff;
  padding:10px 12px;
  border-radius:12px;
  outline:none;
}

/* Buttons (safe) */
.qp-btn{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color:#fff;
  font-weight:800;
  cursor:pointer;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.qp-btn-ghost{ background: rgba(255,255,255,0.04); }
.qp-btn.is-disabled{ opacity:.4; pointer-events:none; }

.qp-table-wrap{ overflow:auto; border-radius:16px; }

/* Drawer */
.qp-drawer-overlay{
  position:fixed; inset:0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  z-index: 9998;
}
.qp-drawer{
  position:fixed;
  top:0; right:0;
  width: min(520px, 92vw);
  height: 100vh;
  background: rgba(15,15,15,0.92);
  border-left: 1px solid rgba(255,255,255,0.10);
  z-index: 9999;
  box-shadow: -40px 0 80px rgba(0,0,0,0.55);
}
.qp-drawer-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:14px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.qp-drawer-title{ font-weight:900; color:#fff; }
.qp-drawer-close{
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  color:#fff;
  border-radius:10px;
  padding:8px 10px;
  cursor:pointer;
  font-weight:900;
}
.qp-drawer-body{
  height: calc(100vh - 60px);
  overflow:auto;
}